-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: archive extraction header.Linkname and old dependencies #80
base: main
Are you sure you want to change the base?
Conversation
return false, fmt.Errorf("couldn't find relative path : %w", err) | ||
} | ||
|
||
if rel != ".." && !(len(rel) >= 3 && rel[:3] == "../") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can remove this condition since the rel
will already be cleaned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be a good idea to copy the validation function the Nomad team worked on and use that to reduce code. https://github.com/hashicorp/nomad/blob/main/helper/escapingfs/escapes.go#L110-L119 maybe under /internal/helper
return false, fmt.Errorf("couldn't find relative path : %w", err) | ||
} | ||
|
||
if rel != ".." && !(len(rel) >= 3 && rel[:3] == "../") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to the following comment: https://github.com/hashicorp/go-slug/pull/80/files#r1937639814
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for looking into that, really appreciate the work. Left some comments and it would be nice to add lots of unit tests (expected failure and valid ones) covering different scenarios included.
This PR is to fix the CVEs in below tickets: