Skip to content
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

Prevent directory traversal in server-supplied filenames #379

Conversation

blyxxyz
Copy link
Collaborator

@blyxxyz blyxxyz commented Jul 8, 2024

If the Content-Disposition header includes directory separators (e.g. /) then we now only take the base filename. Including the directories is a vulnerability.

Originally fixed in 028cbb0 but then broken again in 330d3f2. This time I added a regression test.

Fixes #378.

(Commit based on v0.22.0, we could do a bugfix release instead of a feature release.)

If the `Content-Disposition` header includes directory
separators (e.g. `/`) then we now only take the base
filename. Including the directories is a vulnerability.

Originally fixed in 028cbb0 but then
broken again in 330d3f2. This time I
added a regression test.
@blyxxyz blyxxyz force-pushed the re-fix-download-path-escape branch from eb25c52 to 841f9c2 Compare July 8, 2024 05:47
@ducaale ducaale changed the base branch from master to hotfix/v0.22.0-re-fix-download-path-escape July 8, 2024 21:43
@ducaale ducaale merged commit c2591d5 into ducaale:hotfix/v0.22.0-re-fix-download-path-escape Jul 8, 2024
9 checks passed
@blyxxyz blyxxyz deleted the re-fix-download-path-escape branch July 9, 2024 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Download tries to write to subfolder
2 participants