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

wget utility: invalid path traversal sanitization #516

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

LinRaymond2006
Copy link

Hello @landley ,
I wrote you an email about two weeks ago, but there's no response, so I open a pull request here.

detail

If a Content-Disposition header is received and --output-document (or simply -O) is not specified, the creation of an arbitrary file can be triggered (not an overwrite of any existing files).
I think it's more like an undesirable behavior, rather than a vulnerability, since:

  1. it requires user interaction and a request to an attacker-controlled server.
  2. it does not overwrite any file, and without much information about the victim, it's very unlikely to pose a serious threat to integrity of victim's machine.
  3. executable bit of the output file is not set, there's no direct way for the user to execute the downloaded file.
  4. I did see an attempt to validate the Content-Disposition variable (which seems not functioning). So instead of returning an error when a / is encountered, the patch ignores characters before last / (if any).

reference

rfc 2183 section 5
rfc 2616 section 15.5
rfc 2616 section 19.5.1

@LinRaymond2006
Copy link
Author

Here's the proof-of-concept for your reference.
https://github.com/user-attachments/assets/0f102ec5-5fea-4c38-b8f7-79c7029bb2bd

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.

1 participant