KEVWire

Security intelligence, with context.

Response snapshot Oct 26, 2026, 22:09 UTC

Back to the wire
Permalink
VulnerabilityGHSA-xmj3-9gf7-h52w

setuptools: Windows path escape via namespace_packages.txt during legacy wheel installation Description

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`.

At a glance

Exploited
Not known
Severity
Not scored yet
Chance of exploitation
Not estimated
Sources
1 source

What to do

GitHub lists first patched versions: setuptools: 84.1.0. Confirm the affected range and upgrade guidance in the exact advisory.

Read GitHub-reviewed advisory GHSA-xmj3-9gf7-h52w (opens a new tab)

What happened

### 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

Continue reading

Tested setuptools commit:

`6ead555c5fb29bc57fe6105b1bffc163f56fd558`

Relevant source:

`setuptools/wheel.py`

SHA-256:

`359b7e0d5dd8c3135653abe08a8ed5dc0352eadfd7df22cb5e2b5303b7c3cafd`

The relevant call path is:

`Wheel(wheel_path).install_as_egg(destination)` → `_install_as_egg` → `_convert_metadata` → `_fix_namespace_packages`

A wheel can provide attacker-controlled content in:

` .dist-info/namespace_packages.txt`

The 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.txt ```

A synthetic wheel was created containing:

`demo_pkg-1.0.dist-info/namespace_packages.txt`

whose content was the absolute path of:

`sandbox\outside`

The 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:

`sandbox\destination\EGG-INFO`

but setuptools also created:

`sandbox\outside\__init__.py`

The 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.

Affected package ranges reported by GitHub: setuptools: >= 38.2.2, < 84.1.0

Related technology

Sources

  1. Primary source

    GitHub-reviewed advisory GHSA-xmj3-9gf7-h52w (opens a new tab)

    The public advisory supplies the description, affected package/version ranges, and any listed CVSS metric. GitHub review is not local review.

    Published Checked

  2. Primary source

    GitHub public advisory API page (opens a new tab)

    The API page supplied GHSA-xmj3-9gf7-h52w, its actual identifiers, source dates, and structured metrics.

    Published Date not suppliedChecked

Cite this record

For factual claims, cite the primary sources above; cite KEVWire for its compilation, dates, and classifications.

APA

KEVWire. (2026, October 23). setuptools: Windows path escape via namespace_packages.txt during legacy wheel installation Description. https://kevwire.com/record/GHSA-xmj3-9gf7-h52w

MLA

"setuptools: Windows path escape via namespace_packages.txt during legacy wheel installation Description." KEVWire, 23 Oct. 2026, kevwire.com/record/GHSA-xmj3-9gf7-h52w.

Chicago

KEVWire. "setuptools: Windows path escape via namespace_packages.txt during legacy wheel installation Description." Last modified October 23, 2026. https://kevwire.com/record/GHSA-xmj3-9gf7-h52w.

Evidence summary (plain text)

setuptools: Windows path escape via namespace_packages.txt during legacy wheel installation  Description (Oct 23, 2026).
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.
Sources:
GitHub-reviewed advisory GHSA-xmj3-9gf7-h52w: https://github.com/advisories/GHSA-xmj3-9gf7-h52w
GitHub public advisory API page: https://api.github.com/advisories?type=reviewed&per_page=100&sort=updated&direction=desc
Record ID: GHSA-xmj3-9gf7-h52w.
Record origin: Ingested record.
AI evidence: Not assessed.
Known exploitation: Not assessed.
Zero-day status: Not assessed. KEV membership alone does not establish zero-day status.
About this data

This record was ingested from a data source. Retrieved: Oct 26, 2026, 20:55 UTC. Ingestion is not an independent editorial investigation.

A CISA KEV listing documents known exploitation, not necessarily a zero-day; absence from the catalog does not prove a vulnerability has never been exploited.

Technology tags indicate possible relevance, not verified exposure. Confirm the affected product, version, and configuration against your own inventory; KEVWire does not scan your systems.

A personal reading checklist on this device, not verified remediation.

Record JSON

Your account

Email alerts

Email alerts are not available yet. To follow your stack today, use its RSS feed, which honors your filters, or connect an AI agent through the API.

Suggest an improvement

Ideas, missing sources, corrections, and bugs are all welcome. No account needed. Suggestions are reviewed by a person before anything changes.

Record details

Record detail