{"id":"CVE-2025-47273","aliases":["CVE-2025-47273","GHSA-5rjg-fvgr-3xxf","BIT-SETUPTOOLS-2025-47273","PYSEC-2025-49"],"related":[],"kind":"vulnerability","state":"published","title":"setuptools has a path traversal vulnerability in PackageIndex.download that leads to Arbitrary File Write","summary":"setuptools is a package that allows users to download, build, install, upgrade, and uninstall Python packages. A path traversal vulnerability in `PackageIndex` is present in setuptools prior to version 78.1.1. An attacker would be allowed to write files to arbitrary locations on the filesystem with the permissions of the process running the Python code, which could escalate to remote code execution depending on the context. Version 78.1.1 fixes the issue.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"setuptools is a package that allows users to download, build, install, upgrade, and uninstall Python packages. A path traversal vulnerability in `PackageIndex` is present in setuptools prior to version 78.1.1. An attacker would be allowed to write files to arbitrary locations on the filesystem with the permissions of the process running the Python code, which could escalate to remote code execution depending on the context. Version 78.1.1 fixes the issue.","source":"cvelist"},{"lang":"en","text":"### Summary \nA path traversal vulnerability in `PackageIndex` was fixed in setuptools version 78.1.1\n\n### Details\n```\n    def _download_url(self, url, tmpdir):\n        # Determine download filename\n        #\n        name, _fragment = egg_info_for_url(url)\n        if name:\n            while '..' in name:\n                name = name.replace('..', '.').replace('\\\\', '_')\n        else:\n            name = \"__downloaded__\"  # default if URL has no path contents\n\n        if name.endswith('.[egg.zip](http://egg.zip/)'):\n            name = name[:-4]  # strip the extra .zip before download\n\n -->       filename = os.path.join(tmpdir, name)\n```\n\nHere: https://github.com/pypa/setuptools/blob/6ead555c5fb29bc57fe6105b1bffc163f56fd558/setuptools/package_index.py#L810C1-L825C88\n\n`os.path.join()` discards the first argument `tmpdir` if the second begins with a slash or drive letter.\n`name` is derived from a URL without sufficient sanitization. While there is some attempt to sanitize by replacing instances of '..' with '.', it is insufficient.\n\n### Risk Assessment\nAs easy_install and package_index are deprecated, the exploitation surface is reduced.\nHowever, it seems this could be exploited in a similar fashion like https://github.com/advisories/GHSA-r9hx-vwmv-q579, and as described by POC 4 in https://github.com/advisories/GHSA-cx63-2mw6-8hw5 report: via malicious URLs present on the pages of a package index.\n\n### Impact\nAn attacker would be allowed to write files to arbitrary locations on the filesystem with the permissions of the process running the Python code, which could escalate to RCE depending on the context.\n\n### References\nhttps://huntr.com/bounties/d6362117-ad57-4e83-951f-b8141c6e7ca5\nhttps://github.com/pypa/setuptools/issues/4946","format":"markdown","source":"ghsa"},{"lang":"es","text":"setuptools es un paquete que permite a los usuarios descargar, compilar, instalar, actualizar y desinstalar paquetes de Python. Una vulnerabilidad de path traversal en `PackageIndex` está presente en setuptools anteriores a la versión 78.1.1. Un atacante podría escribir archivos en ubicaciones arbitrarias del sistema de archivos con los permisos del proceso que ejecuta el código Python, lo que podría escalar a la ejecución remota de código según el contexto. La versión 78.1.1 corrige el problema.","source":"nvd"}],"published":"2025-05-17T15:46:11.399Z","modified":"2026-09-10T03:50:24.253Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N/E:P","score":7.7,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N/E:P","score":7.7,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N/E:P","rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"},{"scorer":"Bitnami Vulnerability Database","scheme":"rating","rating":"HIGH"}],"cwes":["CWE-22"],"affected":[{"ranges":[{"version":"< 78.1.1","status":"affected"}],"vendor":"pypa","product":"setuptools","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"78.1.1"}],"ecosystem":"PyPI","package":"setuptools","purl":"pkg:pypi/setuptools","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"78.1.1"}],"vendor":"python","product":"setuptools","cpe":"cpe:2.3:a:python:setuptools:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"11.0"}],"vendor":"debian","product":"debian_linux","cpe":"cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"git","introduced":"0","status":"affected","fixed":"250a6d17978f9f6ac3ac887091f2d32886fbbb0b"},{"type":"ecosystem","introduced":"0","status":"affected","fixed":"78.1.1"}],"ecosystem":"PyPI","package":"setuptools","purl":"pkg:pypi/setuptools","repo":"https://github.com/pypa/setuptools","source":"pysec"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"78.1.1"}],"ecosystem":"Bitnami","package":"setuptools","purl":"pkg:bitnami/setuptools","source":"bitnami"}],"references":[{"url":"https://github.com/pypa/setuptools/security/advisories/GHSA-5rjg-fvgr-3xxf","tags":["advisory","evidence","exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec","bitnami"]},{"url":"https://github.com/pypa/setuptools/issues/4946","tags":["evidence","exploit","issue-tracking","report","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec","bitnami"]},{"url":"https://github.com/pypa/setuptools/commit/250a6d17978f9f6ac3ac887091f2d32886fbbb0b","tags":["fix","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec","bitnami"]},{"url":"https://github.com/pypa/setuptools/blob/6ead555c5fb29bc57fe6105b1bffc163f56fd558/setuptools/package_index.py#L810C1-L825C88","tags":["product","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec","bitnami"]},{"url":"https://lists.debian.org/debian-lts-announce/2025/05/msg00035.html","tags":["article","discussion","mailing-list","web"],"sources":["cvelist","ghsa","nvd","pysec","bitnami"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-47273","tags":["advisory","web"],"sources":["ghsa","bitnami"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/setuptools/PYSEC-2025-49.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":"yes","technicalImpact":"partial","date":"2025-05-19T14:45:34.580Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-47273","url":"https://www.cve.org/CVERecord?id=CVE-2025-47273","licence":"CVE Terms of Use","modified":"2025-05-28T15:03:15.516Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-5rjg-fvgr-3xxf","url":"https://github.com/advisories/GHSA-5rjg-fvgr-3xxf","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:24.253Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-47273","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-47273","licence":"Public domain","modified":"2026-06-17T09:27:38.827Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2025-49","url":"https://osv.dev/vulnerability/PYSEC-2025-49","licence":"CC-BY-4.0","modified":"2026-05-11T00:26:34.671Z"},{"source":"bitnami","name":"Bitnami Vulnerability Database","id":"BIT-SETUPTOOLS-2025-47273","url":"https://osv.dev/vulnerability/BIT-SETUPTOOLS-2025-47273","licence":"Apache-2.0","modified":"2026-09-08T08:48:19.437Z"}],"updatedAt":"2026-11-25T22:58:58.170Z","epss":{"score":0.0162,"percentile":0.76819,"date":"2026-12-02T12:00:21.000Z"}}