security: patch pip's vendored urllib3#68841
Open
twangboy wants to merge 3 commits intosaltstack:3006.xfrom
Open
security: patch pip's vendored urllib3#68841twangboy wants to merge 3 commits intosaltstack:3006.xfrom
twangboy wants to merge 3 commits intosaltstack:3006.xfrom
Conversation
77aa6d7 to
b2e80b2
Compare
sujitdb
approved these changes
Mar 25, 2026
Collaborator
sujitdb
left a comment
There was a problem hiding this comment.
LGTM but is there any test which can verify it?
…6-21441 pip 25.2 vendors urllib3 1.26.20, which contains two security vulnerabilities that affect all Salt builds: CVE-2025-66418 (GHSA-gm62-xv2j-4w53): An attacker-controlled Content-Encoding header with more than 5 chained encodings could cause unbounded resource consumption during decompression. Fixed by limiting MultiDecoder to 5 links. CVE-2026-21441 (GHSA-38jv-5279-wg99): drain_conn() unnecessarily decompressed the full body of HTTP redirect responses even when preload_content=False, creating a decompression-bomb vector. Fixed by tracking _has_decoded_content and skipping decompression in drain_conn when decoding was never initiated. Both patches are backported from upstream urllib3 2.6.3 and validated against Ubuntu's Jammy 1.26.x security backports. CVE-2025-66471 is intentionally not backported — it requires a full 2.x streaming infrastructure refactor, Ubuntu did not backport it to 1.26.x, and pip's maintainers confirmed pip is not affected since all network calls use decode_content=False. The patched files live in pkg/patches/pip-urllib3/ and are applied at build time by _build_patched_pip_wheel(), which downloads pip==25.2, rewrites the wheel zip with the patched urllib3 files, and updates the wheel's RECORD hashes. The patched wheel is then installed and/or copied into the virtualenv embed directory in all three build pipelines: onedir_dependencies, salt_onedir, and the macOS standalone path. The version is reported as "2.6.3" to reflect the highest upstream release from which fixes were drawn, satisfying SCA scanner requirements.
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.
What does this PR do?
security: patch pip's vendored urllib3 for CVE-2025-66418 and CVE-2026-21441
pip 25.2 vendors urllib3 1.26.20, which contains two security vulnerabilities that affect all Salt builds:
CVE-2025-66418 (GHSA-gm62-xv2j-4w53): An attacker-controlled
Content-Encoding header with more than 5 chained encodings could cause
unbounded resource consumption during decompression. Fixed by limiting
MultiDecoder to 5 links.
CVE-2026-21441 (GHSA-38jv-5279-wg99): drain_conn() unnecessarily
decompressed the full body of HTTP redirect responses even when
preload_content=False, creating a decompression-bomb vector. Fixed by
tracking _has_decoded_content and skipping decompression in drain_conn
when decoding was never initiated.
Both patches are backported from upstream urllib3 2.6.3 and validated against Ubuntu's Jammy 1.26.x security backports. CVE-2025-66471 is intentionally not backported — it requires a full 2.x streaming infrastructure refactor, Ubuntu did not backport it to 1.26.x, and pip's maintainers confirmed pip is not affected since all network calls use decode_content=False.
The patched files live in pkg/patches/pip-urllib3/ and are applied at build time by _build_patched_pip_wheel(), which downloads pip==25.2, rewrites the wheel zip with the patched urllib3 files, and updates the wheel's RECORD hashes. The patched wheel is then installed and/or copied into the virtualenv embed directory in all three build pipelines: onedir_dependencies, salt_onedir, and the macOS standalone path.
The version is reported as "2.6.3" to reflect the highest upstream release from which fixes were drawn, satisfying SCA scanner requirements.
What issues does this PR fix or reference?
Fixes BlackDuck
Merge requirements satisfied?
[NOTICE] Bug fixes or features added to Salt require tests.
Commits signed with GPG?
Yes