PT-2026-162295
Published
2026-11-19
·
Updated
2026-11-19
Description by
CVSS 4.0
1.0
LowMetricsAV:L/AC:H/AT:P/PR:L/UI:A/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N
Summary
On Windows, attacker-controlled content in a wheel's
.dist-info/namespace packages.txt can cause setuptools' legacy wheel
installation path to create an init .py outside the requested
destination eggdir.The attacker can influence the destination path, but not the contents of
the created file.
Details
Tested setuptools commit:
6ead555c5fb29bc57fe6105b1bffc163f56fd558Relevant source:
setuptools/wheel.pySHA-256:
359b7e0d5dd8c3135653abe08a8ed5dc0352eadfd7df22cb5e2b5303b7c3cafdThe relevant call path is:
Wheel(wheel path).install as egg(destination)
→ install as egg
→ convert metadata
→ fix namespace packagesA wheel can provide attacker-controlled content in:
<distribution>.dist-info/namespace packages.txtThe namespace value is eventually used approximately as:
python
mod dir = os.path.join(destination eggdir, *mod.split('.'))
mod init = os.path.join(mod dir, ' init .py')
If mod is a Windows drive-qualified absolute path containing no dots,
mod.split('.') preserves it as a single component.
On Windows, os.path.join(destination eggdir, absolute component) discards
the original base directory and resolves to the attacker-supplied absolute
path.
The existing wheel filename and ZIP traversal checks do not validate this
metadata value before it is subsequently interpreted as a filesystem path.
```markdown
### PoC
The reproduction was performed entirely inside a disposable temporary
directory.
Layout:
```text
sandbox/
destination/
outside/
input/
canary.txtA synthetic wheel was created containing:
demo pkg-1.0.dist-info/namespace packages.txtwhose content was the absolute path of:
sandboxoutsideThe real acquired setuptools implementation was then invoked:
python
setuptools.wheel.Wheel(synthetic wheel).install as egg(
sandbox destination
)The operation completed without exception.
Expected metadata was created under:
sandboxdestinationEGG-INFObut setuptools also created:
sandboxoutside init .pyThe file did not exist before execution.
Its contents were:
python
import ('pkg resources').declare namespace( name )The unrelated canary remained byte-identical.
The sandbox was deleted after recording the evidence.
### Impact
A crafted wheel can cause setuptools to create a fixed-content
` init .py` outside the intended installation directory at a
filesystem path influenced by the wheel, with the permissions of the
process performing the installation.
The demonstrated reproduction required the target parent directory to
already exist.Exploitability
Fix
Vendors
Affected products
Related identifiers
Found an issue in the description? Have something to add? Feel free to write us 👾