Repository navigation
🐛 fix(seed): contain metadata lookups - #3649
Merged
gaborbernat merged 2 commits intoNov 20, 2026
Merged
Conversation
gaborbernat
force-pushed
the
fix/3624-contain-seed-lookups
branch
from
November 20, 2026 06:29
0e53221 to
20fea37
Compare
gaborbernat
marked this pull request as draft
November 20, 2026 06:34
gaborbernat
force-pushed
the
fix/3624-contain-seed-lookups
branch
4 times, most recently
from
November 20, 2026 09:09
af2a7f9 to
4bb17f5
Compare
The cleanup guard from pypa#3428 runs after checking RECORD paths. A malformed absolute path can trigger an outside lookup before removal is rejected. Check lexical and resolved parents before querying metadata entries or their bytecode directories. Keep relative entries within the environment. Fixes pypa#3624
Resolving a parent link can probe outside the environment before the guard returns. Limit the early check to path text and leave the existing containment check to protect deletion. Exercise absolute and traversal entries through reseeding.
gaborbernat
force-pushed
the
fix/3624-contain-seed-lookups
branch
from
November 20, 2026 10:46
4bb17f5 to
0509881
Compare
gaborbernat
marked this pull request as ready for review
November 20, 2026 12:28
This was referenced Nov 20, 2026
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.
_uninstall_distchecked an absolute or..path listed in existing package metadata before deciding whether it belonged to the environment. Such an entry could cause a filesystem lookup elsewhere during reseeding. The lookup is now skipped when the entry leaves the environment lexically. Fixes #3624.Metadata path resolution
An absolute right-hand path replaces the left-hand path when
RECORDentries are joined tosite-packages. The old_record_pathsalso searched the derived__pycache__directory before the cleanup guard ran. It now checks the lexical path before that search (new code).Cleanup ordering
The old cleanup loop called
exists()before resolving containment. The new lexical guard rejects absolute and..entries outside the environment before that call. The existing resolved-path check still controls removal through parent links.Behavior changes
Malformed absolute and
..metadata entries outside the environment are skipped with a warning. Relative entries that reach another directory within the environment, such as../../../bin/pip, remain eligible for cleanup. Parent links still use the existing post-lookup containment check. The report did not establish a Windows network request or credential use from the old lookup.Reported by oss-scanner: ANT-2026-5PAH96SM.