Skip to main content

CVE-2025-47273: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in pypa setuptools

High
VulnerabilityCVE-2025-47273cvecve-2025-47273cwe-22
Published: Sat May 17 2025 (05/17/2025, 15:46:11 UTC)
Source: CVE
Vendor/Project: pypa
Product: setuptools

Description

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.

AI-Powered Analysis

AILast updated: 07/11/2025, 10:32:02 UTC

Technical Analysis

CVE-2025-47273 is a high-severity path traversal vulnerability affecting the Python setuptools package prior to version 78.1.1. Setuptools is a widely used package management library that facilitates downloading, building, installing, upgrading, and uninstalling Python packages. The vulnerability exists in the PackageIndex component, where improper limitation of pathname inputs allows an attacker to write files to arbitrary locations on the filesystem. This occurs because the software fails to correctly restrict file paths to a safe directory, enabling path traversal attacks (CWE-22). Exploiting this flaw requires no authentication or user interaction and can be performed remotely if the attacker can influence the input to setuptools. The attacker can write files with the permissions of the process running the Python code, potentially leading to remote code execution depending on the execution context. This could allow an attacker to implant malicious code, modify critical files, or disrupt system operations. The issue is fixed in setuptools version 78.1.1. The CVSS 4.0 base score is 7.7, reflecting the vulnerability's network attack vector, low attack complexity, no privileges or user interaction required, and high impact on integrity. No known exploits are currently reported in the wild, but the widespread use of setuptools in Python environments makes this a significant risk if left unpatched.

Potential Impact

For European organizations, this vulnerability poses a substantial risk due to the extensive use of Python and setuptools in software development, automation, data analysis, and web services. Successful exploitation could lead to unauthorized file writes, enabling attackers to execute arbitrary code, escalate privileges, or disrupt critical services. This can compromise confidentiality, integrity, and availability of systems. Organizations relying on Python-based applications, CI/CD pipelines, or automated deployment tools that use setuptools are particularly vulnerable. The risk is amplified in environments where Python processes run with elevated privileges or on critical infrastructure. Additionally, supply chain attacks could leverage this vulnerability to inject malicious code into widely distributed Python packages, affecting a broad range of downstream users. The impact could extend to data breaches, service outages, and reputational damage, especially in sectors like finance, healthcare, and government where Python is heavily utilized.

Mitigation Recommendations

European organizations should immediately audit their environments to identify systems running setuptools versions prior to 78.1.1. The primary mitigation is to upgrade setuptools to version 78.1.1 or later, which contains the fix for this vulnerability. For environments where immediate upgrade is not feasible, organizations should restrict network access to systems running vulnerable versions, especially from untrusted sources. Implement strict input validation and sandboxing for any processes invoking setuptools to limit the potential for path traversal exploitation. Monitoring and alerting on unusual file write activities or modifications outside expected directories can help detect exploitation attempts. Incorporating vulnerability scanning into CI/CD pipelines to detect outdated setuptools versions will prevent future exposure. Additionally, reviewing and minimizing the privileges of Python processes can reduce the impact of a successful exploit. Organizations should also stay alert for any emerging exploit code and apply security patches promptly.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
GitHub_M
Date Reserved
2025-05-05T16:53:10.372Z
Cisa Enriched
true
Cvss Version
4.0
State
PUBLISHED

Threat ID: 682cd0f81484d88663aeb71a

Added to database: 5/20/2025, 6:59:04 PM

Last enriched: 7/11/2025, 10:32:02 AM

Last updated: 8/13/2025, 10:51:46 PM

Views: 19

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats