CVE-2025-47273 — setuptools
Fix: pypa/setuptools@250a6d1CVE-2025-47273 is a Path Traversal vulnerability in setuptools. A fix is available for setuptools — see the affected versions and patch details below.
setuptools has a path traversal vulnerability in PackageIndex.download that leads to Arbitrary File Write
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
Exploitation and automatability from CISA’s SSVC triage for CVE-2025-47273.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
Real-World Exposure
setuptoolsReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.
Description
Summary
A path traversal vulnerability in PackageIndex was fixed in setuptools version 78.1.1
Details
def _download_url(self, url, tmpdir):
# Determine download filename
#
name, _fragment = egg_info_for_url(url)
if name:
while '..' in name:
name = name.replace('..', '.').replace('\\', '_')
else:
name = "__downloaded__" # default if URL has no path contents
if name.endswith('.[egg.zip](http://egg.zip/)'):
name = name[:-4] # strip the extra .zip before download
--> filename = os.path.join(tmpdir, name)
os.path.join() discards the first argument tmpdir if the second begins with a slash or drive letter.
name is derived from a URL without sufficient sanitization. While there is some attempt to sanitize by replacing instances of '..' with '.', it is insufficient.
Risk Assessment
As easy_install and package_index are deprecated, the exploitation surface is reduced. However, 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.
Impact
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 RCE depending on the context.
References
https://huntr.com/bounties/d6362117-ad57-4e83-951f-b8141c6e7ca5 https://github.com/pypa/setuptools/issues/4946
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐍PyPI | setuptools | all versions | 78.1.1pip install --upgrade 'setuptools==78.1.1' |
Affected Products
debian linuxdebiansetuptoolspythonDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for setuptools, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update setuptools to 78.1.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2025-47273 is resolved across your whole dependency graph.
Workarounds
Resolve every user-supplied path to its canonical form and reject anything that escapes the intended directory, and run the component under an account that has no read or write access outside the directory it legitimately serves.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
Red Hat Product Security has rated this vulnerability "Moderate" based on the impact of the damage caused by a successful exploitation and the pre-requisites. * Exploitation requires that the attacker have limited code execution access to a Python environment where they can trigger the vulnerable…
Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base or stability.Source: Red Hat security advisory for CVE-2025-47273 (CC BY 4.0)
| Product | Fixed in | Advisory |
|---|---|---|
| Red Hat Ansible Automation Platform 2.5 for RHEL 8 | automation-controller-0:4.6.19-1.el8ap | RHSA-2025:14686 |
| Red Hat Enterprise Linux 10 | python-setuptools-0:69.0.3-12.el10_0 | RHSA-2025:9940 |
| Red Hat Enterprise Linux 7 Extended Lifecycle Support | python3-setuptools-0:39.2.0-10.el7_9.2 | RHSA-2025:11607 |
| Red Hat Enterprise Linux 7 Extended Lifecycle Support | python-setuptools-0:0.9.8-7.el7_9.2 | RHSA-2025:11984 |
| Red Hat Enterprise Linux 8 | python3.11-setuptools-0:65.5.1-4.el8_10 | RHSA-2025:11043 |
| Red Hat Enterprise Linux 8 | python3.12-setuptools-0:68.2.2-5.el8_10 | RHSA-2025:11044 |
| Red Hat Enterprise Linux 8 | python39:3.9-8100020250823160619.d47b87a4 | RHSA-2025:14900 |
| Red Hat Enterprise Linux 8 | python-setuptools-0:39.2.0-9.el8_10 | RHSA-2025:11036 |
Frequently Asked Questions
Is CVE-2025-47273 in your dependencies?
Find it across PyPI, including transitive dependencies.