fix(wget2): CVE-2025-69194, CVE-2025-69195#3
Merged
Conversation
Add path traversal validation for Metalink <file name> elements. The application failed to properly validate file paths provided in Metalink documents, allowing an attacker to write files to unintended locations on the system. Backport of upstream commit ab335eb3d5880080497b866a70344cc66d09bc2d which adds sanitized_filename() using ISSLASH/FILE_SYSTEM_PREFIX_LEN macros from filename.h. Upstream: https://gitlab.com/gnuwget/wget2/-/commit/ab335eb3d5880080497b866a70344cc66d09bc2d Generated-By: glm-5.1 Co-Authored-By: hudeng <hudeng@deepin.org>
Sanitize filename from Content-Disposition header to prevent stack-based buffer overflow in filename sanitization logic when processing attacker-controlled URL paths, particularly when filename restriction options are active. Backport of upstream commit beba9c92d826ca3e8f9bc96e6c37fa669d822666 which adds sanitize_filename() to strip directory traversal sequences from Content-Disposition filenames. Upstream: https://gitlab.com/gnuwget/wget2/-/commit/beba9c92d826ca3e8f9bc96e6c37fa669d822666 Generated-By: glm-5.1 Co-Authored-By: hudeng <hudeng@deepin.org>
|
TAG Bot TAG: 2.1.0-2.1deepin3 |
Contributor
Author
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Contributor
|
/integrate |
|
AutoIntegrationPr Bot |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CVE Security Fix
This PR fixes two security vulnerabilities in wget2:
CVE-2025-69194 - Arbitrary File Write via Metalink Path Traversal
The application failed to properly validate file paths provided in Metalink
<file name>elements. An attacker could abuse this behavior to write files to unintended locations on the system, leading to data loss or further compromise.Fix: Add
sanitized_filename()function tolibwget/metalink.cthat validates Metalink file names against path traversal attacks usingISSLASH/FILE_SYSTEM_PREFIX_LENmacros fromfilename.h.Upstream: https://gitlab.com/gnuwget/wget2/-/commit/ab335eb3d5880080497b866a70344cc66d09bc2d
CVE-2025-69195 - Stack-based Buffer Overflow via Filename Sanitization
A stack-based buffer overflow occurs in the filename sanitization logic when processing attacker-controlled URL paths, particularly when filename restriction options are active. A remote attacker can exploit this by providing a specially crafted URL, leading to memory corruption and potential crash.
Fix: Add
sanitize_filename()function tolibwget/http_parse.cthat strips directory traversal sequences from Content-Disposition filenames.Upstream: https://gitlab.com/gnuwget/wget2/-/commit/beba9c92d826ca3e8f9bc96e6c37fa669d822666
Generated-By: glm-5.1
Co-Authored-By: hudeng hudeng@deepin.org