Skip to content

🐛 fix(seed): validate extra search directories - #3737

Merged
gaborbernat merged 2 commits into
pypa:mainfrom
gaborbernat:fix/zc2p1m2r
Nov 20, 2026
Merged

gaborbernat merged 2 commits into
pypa:mainfrom
gaborbernat:fix/zc2p1m2r

Conversation

@gaborbernat

@gaborbernat gaborbernat commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

An empty --extra-search-dir entry could select the working directory for wheel search, while a file entry could fail seeding with NotADirectoryError. The seeder now searches existing directories only and rejects an explicit empty command-line value. This addresses draft advisory ANT-2026-ZC2P1M2R.

List conversion skips empty entries from configuration and environment variables. That keeps empty --extra-search-dir, --python, and --try-first-with entries from selecting the working directory or running interpreter. The seeder checks for directories and rejects an explicitly empty search directory instead of silently changing the search scope.

Behavior changes

An explicit empty command-line value now fails with an argument error. Empty list entries from configuration or environment variables and file search entries are skipped. Missing search directories are still skipped.

The file-entry fix was contributed by Pratik-Kumar-Dhakar in #3688. Fixes #3582. Reported by oss-scanner: ANT-2026-ZC2P1M2R.

@gaborbernat gaborbernat added bug security Fixes a vulnerability or hardens the supply chain, CI or release labels Nov 20, 2026
@gaborbernat gaborbernat changed the title 🐛 fix(seed): discard empty search paths 🐛 fix(seed): validate extra search directories Nov 20, 2026
@gaborbernat
gaborbernat marked this pull request as ready for review November 20, 2026 17:46
@gaborbernat
gaborbernat merged commit 5f3a145 into pypa:main Nov 20, 2026
128 of 155 checks passed
@gaborbernat
gaborbernat deleted the fix/zc2p1m2r branch November 23, 2026 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug security Fixes a vulnerability or hardens the supply chain, CI or release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--extra-search-dir pointing at a file crashes seeding with a misleading download error

1 participant