Repository navigation
fix(sdist): reject symlink path traversal and members under symlinked paths - #1303
Draft
Abdur-Rafay-AR wants to merge 2 commits into
Draft
Abdur-Rafay-AR wants to merge 2 commits into
Abdur-Rafay-AR wants to merge 2 commits into
Conversation
… paths Fixes pypa#1265 Signed-off-by: Abdur-Rafay-AR <abdurrafay.tech@gmail.com>
Abdur-Rafay-AR
requested review from
gaborbernat,
henryiii and
layday
as code owners
November 20, 2026 05:35
Signed-off-by: Abdur-Rafay-AR <abdurrafay.tech@gmail.com>
Abdur-Rafay-AR
marked this pull request as draft
November 20, 2026 06:14
Author
|
I realized I jumped ahead of the open design discussion on #1265 here — converting this to draft while you and @henryiii discuss whether to address this behavior and whether rejecting parent symlinks is too strict. Happy to wait for consensus on the direction before this goes any further, or to rework/close it once you've landed on an approach. |
Contributor
|
I think we should do the things I mentioned on the issue:
I have not checked the added logic to see if that's the right place to put it. However, we should agree on this in the issue first. We might decide it's not our place to patch and we should expect users to upgrade Python if they are worried about this CVE. In that case, this is just a simple change. |
This branch has not been deployed
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.
Why I decided to contribute
Passionate Python developer interested in packaging security and improving build tooling reliability across the PyPA ecosystem.
Description
Fixes #1265.
In
_prepare_sdist_archive():linkname in ('.', './').archive.extractall, switchesfilter='fully_trusted'back tofilter='data'to ensure stdlib dynamic runtime filtering remains active during extraction.Added regression test
test_extract_sdist_rejects_symlink_chainingintests/test_main.py.Changelog
docs/changelog/1265.bugfix.rstChecklist
docs/development/contributing.rst)tests/test_main.py- 133 passed)