GitHub advisory · PyPI
virtualenv: Seed replacement does not contain metadata deletion paths
Description
The app-data seeder joins paths from existing distribution metadata to site-packages and deletes the resulting paths without checking containment within the environment.
Anthropic's OSS Scanner reported this as ANT-2026-SXOEHWP7 in virtualenv-20261015-005, received on 15 October 2026.
Removal of a previously installed seed package.
An environment being reused must contain distribution metadata influenced by another account. The invoking user must have deletion rights over the paths named by that metadata. Installing a new environment without existing package metadata does not enter this cleanup path.
The relevant 21.14.8 source is in seed uninstall.
Before reinstalling a seed wheel, PipInstall._uninstall_previous_version() accepts an existing pip-*.dist-info
directory in the destination. _uninstall_dist() reads its top_level.txt and RECORD, joins each entry to
site-packages, and deletes the result. It does not check whether .., an absolute entry, or a linked parent takes the
path outside the environment. The default app-data seeder reaches this path when it reuses a tree containing
seed-package metadata; --clear removes that tree first.
The scanner prepared a project with .venv/lib/python3.14/site-packages/pip-1.0.dist-info/. Its top_level.txt
contained ../../../../../Documents; its RECORD named ../../../../../notes.txt,,. The user's home initially held
Documents/thesis/chapter1.txt and notes.txt. Running virtualenv .venv exited successfully but removed both paths.
A control tree with top_level.txt set to pip and a normal pip/__init__.py RECORD entry left the home files in
place. The reproducer prints BUG only when the control files survive and both attack…
Manual fix · PyPI
pip install --upgrade "virtualenv>=21.14.9"Sources