Executive brief
Setuptools is a widely used tool for packaging Python software. A vulnerability in its packaging process on macOS systems could cause sensitive files, such as private keys or local configuration files, to be accidentally included in public software releases even if the developer explicitly tried to exclude them. This occurs because the tool fails to recognize certain characters in filenames that look identical but are stored differently on disk, potentially leading to the irreversible exposure of private data on public repositories like PyPI.
Technical details
A vulnerability in setuptools' FileList component allows for the bypass of MANIFEST.in exclusion directives (e.g., exclude, global-exclude) when building source distributions (sdist) on macOS systems using APFS or HFS+ filesystems. The root cause is a byte-for-byte comparison between MANIFEST.in patterns (typically in NFC) and on-disk filenames (often in NFD) without performing Unicode normalization. An attacker or environmental condition can result in sensitive files being included in the final .tar.gz archive despite matching exclusion rules. This issue is specific to non-ASCII filenames on normalization-preserving filesystems. The vulnerability is addressed in version 83.0.0 by normalizing both paths and patterns to a canonical form before matching.
Affected products
- pypa setuptools < 83.0.0
Timeline
- 2026-07-04: disclosed: Initial disclosure date reported by researcher
- 2026-07-04: patched: Version 83.0.0 released
- 2026-07-21: advisory: GitHub Advisory published
References
- https://api.github.com/users/tomasilluminati
- https://github.com/tomasilluminati
- https://api.github.com/users/tomasilluminati/gists%7B/gist_id%7D
- https://api.github.com/users/tomasilluminati/repos
- https://avatars.githubusercontent.com/u/147225560?v=4
- https://api.github.com/users/tomasilluminati/events%7B/privacy%7D