# setuptools path escape via namespace_packages.txt on Windows

Source: https://junglewise.ai/threats/setuptools-windows-path-escape-via-namespace-packages-txt-during-legacy-93ae767b  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-10-23. Updated: 2026-10-25  
License: CC BY 4.0 with a link back

Severity: medium · CVSS 4 · Published 2026-10-23

setuptools is a Python library that manages package installation and distribution. On Windows systems, a malicious wheel package could cause setuptools to create files outside the intended installation directory during legacy wheel installation. An attacker could place an __init__.py file in an arbitrary location on the filesystem where the parent directory exists, potentially affecting system integrity or enabling privilege escalation depending on file permissions.

Technologies: [setuptools (PyPI)](https://junglewise.ai/threats/technologies/pypi-setuptools), [Python Packaging Authority Setuptools](https://junglewise.ai/threats/technologies/setuptools). Vendors: [PyPI](https://junglewise.ai/threats/vendors/pypi), [Python Packaging Authority](https://junglewise.ai/threats/vendors/python-packaging-authority).

## Quick answers

**Is This vulnerability exploited in the wild?** No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.

**How severe is This vulnerability?** Medium severity, with a CVSS score of 4, published 23 October 2026.

**Which products and versions are affected?** setuptools (PyPI) >= 38.2.2, < 84.1.0, ECOSYSTEM:introduced=38.2.2,fixed=84.1.0; Python Packaging Authority Setuptools >= 38.2.2, < 84.1.0.

**Is there a fix for This vulnerability?** Yes. setuptools (PyPI): upgrade to 84.1.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is This vulnerability attacked?** It is in a software library.

**Am I affected?** Check whether you run setuptools (PyPI) or Python Packaging Authority Setuptools at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- setuptools (PyPI): upgrade to 84.1.0 or later

  ```sh
  pip install "setuptools>=84.1.0"
  ```


## Technical details

The vulnerability exists in setuptools' legacy wheel installation path (_fix_namespace_packages) on Windows. Attacker-controlled content in a wheel's .dist-info/namespace_packages.txt is split on dots and passed directly to os.path.join(); if a namespace entry is an absolute Windows path with no dots, it remains a single component, and os.path.join() then discards the base directory and resolves to the attacker-supplied absolute path. The vulnerability requires local access to install the malicious wheel, existing parent directories at the target location, and cannot write arbitrary content (only fixed __init__.py with namespace declaration).

## Affected products

- Python Packaging Authority setuptools >= 38.2.2, < 84.1.0

## Timeline

- 2026-10-19: disclosed
- 2026-10-19: patched: Fix released in version 84.1.0

## References

- [https://github.com/pypa/setuptools/security/advisories/GHSA-xmj3-9gf7-h52w](https://github.com/pypa/setuptools/security/advisories/GHSA-xmj3-9gf7-h52w)
- [https://github.com/pypa/setuptools/pull/5329](https://github.com/pypa/setuptools/pull/5329)

## Related threats

- [pypa setuptools Unicode normalization bypass in MANIFEST.in exclusions](https://junglewise.ai/threats/cve-2026-59890-pypa-setuptools-unicode-normalization-bypass-in-manifest-in)
- [PYSEC-2026-1918 - setuptools vulnerable to Command Injection via package URL](https://junglewise.ai/threats/cve-2024-6345-setuptools-vulnerable-to-command-injection-via-package-url)
- [PyPA wheel path traversal in unpack function](https://junglewise.ai/threats/cve-2026-24049-pypa-wheel-path-traversal-in-unpack-function)
- [setuptools has a path traversal vulnerability in PackageIndex.download that leads to Arbitrary File Write](https://junglewise.ai/threats/cve-2025-47273-setuptools-has-a-path-traversal-vulnerability-in-packageindex)
- [pypa/setuptools vulnerable to Regular Expression Denial of Service (ReDoS)](https://junglewise.ai/threats/cve-2022-40897-pypa-setuptools-vulnerable-to-regular-expression-denial-of)
