{"id":"CVE-2026-59890","aliases":["CVE-2026-59890","GHSA-h35f-9h28-mq5c","BIT-SETUPTOOLS-2026-59890","PYSEC-2026-3447"],"related":[],"kind":"vulnerability","state":"published","title":"setuptools: MANIFEST.in exclusion bypass in sdist via Unicode normalization collision (NFC/NFD) on macOS APFS/HFS+","summary":"setuptools is a package that allows users to download, build, install, upgrade, and uninstall Python packages. Prior to 83.0.0, FileList applied MANIFEST.in exclude, global-exclude, recursive-exclude, and prune directives by matching compiled glob patterns against on-disk file names without Unicode normalization, so on macOS APFS or HFS+ an NFD file name could bypass an NFC exclusion rule and be packed into a source distribution. This issue is fixed in version 83.0.0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"setuptools is a package that allows users to download, build, install, upgrade, and uninstall Python packages. Prior to 83.0.0, FileList applied MANIFEST.in exclude, global-exclude, recursive-exclude, and prune directives by matching compiled glob patterns against on-disk file names without Unicode normalization, so on macOS APFS or HFS+ an NFD file name could bypass an NFC exclusion rule and be packed into a source distribution. This issue is fixed in version 83.0.0.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nWhen building a source distribution (`python -m build --sdist` / `setup.py sdist`), setuptools' `FileList` applies `MANIFEST.in` directives (`exclude`, `global-exclude`, `recursive-exclude`, `prune`) by matching a compiled glob against on-disk file names **byte-for-byte, with no Unicode normalization**. On normalization-preserving filesystems (notably macOS APFS and HFS+), a file written in NFD and a `MANIFEST.in` rule written in NFC refer to the same file but are byte-distinct, so the exclusion silently fails to match. A file the maintainer intended to exclude is then packed into the `.tar.gz` and, if published, uploaded to the public, immutable PyPI index.\n\n## Details\n\nFile names in `FileList.files` come from `os.walk` (`setuptools/_distutils/filelist.py`, `_find_all_simple`), so on APFS a file written NFD is offered to the matcher in NFD, while the `MANIFEST.in` pattern carries the author's editor form (typically NFC). The matching path performs no canonicalization:\n\n```python\n# setuptools/command/egg_info.py  (FileList.global_exclude)\ndef global_exclude(self, pattern):\n    match = translate_pattern(os.path.join('**', pattern))   # fnmatch.translate -> regex, no NFC/NFD\n    return self._remove_files(match.match)                   # byte-level regex over raw os.walk names\n```\n\nA rule written NFC (`café` = `63 61 66 c3 a9`) does not match an on-disk name written NFD (`café` = `63 61 66 65 cc 81`), even though the filesystem treats the two as one file.\n\nA `unicodedata.normalize('NFD', ...)` helper exists in `setuptools/unicode_utils.py` (`decompose()`), but it is **never called in the manifest matching path**, so neither the pattern nor the walked path is normalized before matching. The only normalization in this area, `EggInfoCommand._manifest_normalize`, uses `filesys_decode` (bytes→str decode only, no NFC/NFD) and runs when writing `SOURCES.txt`, after matching has already occurred.\n\n## Impact\n\n`MANIFEST.in` exclusions are the documented mechanism maintainers use to keep secrets, local configs, and private fixtures out of the published sdist. A non-ASCII excluded file may be published to the public, immutable PyPI index despite the rule — an irreversible disclosure with no visual cue (NFC and NFD forms render identically). Exposure is filesystem-dependent and most relevant on macOS APFS/HFS+, where many maintainers build and publish. Pure-ASCII rules are unaffected.\n\n## Proof of concept\n\nWith a project containing `MANIFEST.in`:\n\n```\nglobal-include *.txt *.json\nglobal-exclude secret_café.txt    # rule saved NFC\n```\n\nand an on-disk file `secret_café.txt` written in NFD, `python -m build --sdist` packs the secret file into the resulting `.tar.gz`, while an ASCII control file excluded by the same directive is correctly dropped — isolating the bypass to the NFC-pattern vs. NFD-name mismatch. Reproduced on macOS APFS with setuptools 82.0.1.\n\n## Remediation\n\nNormalize both the walked path and each `MANIFEST.in` pattern to a single canonical form before matching, in both `setuptools/command/egg_info.py` (`FileList`) and the vendored `setuptools/_distutils/filelist.py`. For an exclusion list, err toward excluding more, and document that `MANIFEST.in` matching is normalization-insensitive on macOS.\n\n## Credit\n\nReported by Tomas Illuminati. Coordinated via CERT/CC VINCE VU#604762.","format":"markdown","source":"ghsa"},{"lang":"es","text":"setuptools es un paquete que permite a los usuarios descargar, construir, instalar, actualizar y desinstalar paquetes Python. Antes de la 83.0.0, FileList aplicaba las directivas de exclusión, exclusión global, exclusión recursiva y poda de MANIFEST.in al hacer coincidir patrones glob compilados con nombres de archivo en disco sin normalización Unicode, por lo que en macOS APFS o HFS+ un nombre de archivo NFD podría eludir una regla de exclusión NFC y ser empaquetado en una distribución de origen. Este problema está solucionado en la versión 83.0.0.","source":"nvd"}],"published":"2026-07-08T16:02:07.519Z","modified":"2026-10-25T17:10:00.197Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:L/A:N","score":6.1,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"Bitnami Vulnerability Database","scheme":"rating","rating":"MEDIUM"}],"cwes":["CWE-176","CWE-697"],"affected":[{"ranges":[{"version":"< 83.0.0","status":"affected"}],"vendor":"pypa","product":"setuptools","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"83.0.0"}],"ecosystem":"PyPI","package":"setuptools","purl":"pkg:pypi/setuptools","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"83.0.0"}],"vendor":"python","product":"setuptools","cpe":"cpe:2.3:a:python:setuptools:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"83.0.0"}],"ecosystem":"PyPI","package":"setuptools","purl":"pkg:pypi/setuptools","source":"pysec"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"83.0.0"}],"ecosystem":"Bitnami","package":"setuptools","purl":"pkg:bitnami/setuptools","source":"bitnami"}],"references":[{"url":"https://github.com/pypa/setuptools/security/advisories/GHSA-h35f-9h28-mq5c","tags":["advisory","evidence","exploit","mitigation","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec","bitnami"]},{"url":"https://github.com/pypa/setuptools/commit/dd9f436a36486b4cb8a4c70a2321548b0be09b8f","tags":["fix","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec","bitnami"]},{"url":"https://github.com/pypa/setuptools/releases/tag/v83.0.0","tags":["advisory","article","release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec","bitnami"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-59890","tags":["advisory","web"],"sources":["ghsa","bitnami"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/setuptools/PYSEC-2026-3447.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/pypa/setuptools","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-07-08T16:44:32.194Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-59890","url":"https://www.cve.org/CVERecord?id=CVE-2026-59890","licence":"CVE Terms of Use","modified":"2026-07-08T16:44:52.269Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-h35f-9h28-mq5c","url":"https://github.com/advisories/GHSA-h35f-9h28-mq5c","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:52.323Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-59890","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-59890","licence":"Public domain","modified":"2026-10-25T17:10:00.197Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-3447","url":"https://osv.dev/vulnerability/PYSEC-2026-3447","licence":"CC-BY-4.0","modified":"2026-07-14T10:56:37.948Z"},{"source":"bitnami","name":"Bitnami Vulnerability Database","id":"BIT-SETUPTOOLS-2026-59890","url":"https://osv.dev/vulnerability/BIT-SETUPTOOLS-2026-59890","licence":"Apache-2.0","modified":"2026-09-08T08:48:19.342Z"}],"updatedAt":"2026-11-25T22:59:27.400Z","epss":{"score":0.0053,"percentile":0.46283,"date":"2026-12-01T12:00:22.000Z"}}