CVE-2024-6345: CWE-94 Improper Control of Generation of Code in pypa pypa/setuptools
A vulnerability in the package_index module of pypa/setuptools versions up to 69.1.1 allows for remote code execution via its download functions. These functions, which are used to download packages from URLs provided by users or retrieved from package index servers, are susceptible to code injection. If these functions are exposed to user-controlled inputs, such as package URLs, they can execute arbitrary commands on the system. The issue is fixed in version 70.0.
AI Analysis
Technical Summary
CVE-2024-6345 is a vulnerability classified under CWE-94 (Improper Control of Generation of Code) found in the pypa/setuptools package, a widely used Python package management tool. The flaw exists in the package_index module's download functions, which are responsible for fetching packages from URLs either provided directly by users or retrieved from package index servers. These functions fail to properly sanitize or validate the URLs, allowing an attacker to inject malicious code that gets executed on the host system. This remote code execution (RCE) vulnerability can be triggered without requiring authentication but does require user interaction, such as initiating a package installation or update process that involves a crafted URL. The vulnerability affects all setuptools versions up to 69.1.1 and has been addressed in version 70.0. The CVSS v3.0 score of 8.8 reflects the high impact on confidentiality, integrity, and availability, combined with the ease of exploitation due to network vector and low attack complexity. Although no exploits are currently known in the wild, the critical nature of setuptools in Python environments and its integration in development and deployment pipelines makes this vulnerability a significant threat. Attackers exploiting this flaw could execute arbitrary commands, potentially leading to full system compromise, data theft, or disruption of services.
Potential Impact
For European organizations, the impact of CVE-2024-6345 can be severe. Many enterprises, research institutions, and government agencies rely heavily on Python for software development, automation, and data analysis. The setuptools package is a fundamental tool in Python package management, often used in CI/CD pipelines, automated deployments, and development environments. Exploitation could lead to unauthorized code execution on build servers, developer workstations, or production systems, resulting in data breaches, insertion of malicious code into software supply chains, or disruption of critical services. The compromise of development infrastructure could also facilitate further attacks, including lateral movement within networks and persistence. Given the interconnected nature of European IT ecosystems and the reliance on open-source software, this vulnerability poses a systemic risk that could affect multiple sectors including finance, healthcare, manufacturing, and public administration.
Mitigation Recommendations
To mitigate this vulnerability, European organizations should immediately upgrade all instances of pypa/setuptools to version 70.0 or later, where the issue is fixed. Additionally, organizations should audit and restrict the sources of package URLs used in automated scripts, CI/CD pipelines, and manual installations to trusted repositories only. Implementing strict input validation and sanitization on any user-supplied URLs related to package downloads is critical to prevent injection attacks. Monitoring and logging package installation activities can help detect suspicious behavior early. Organizations should also consider isolating build and deployment environments to limit the impact of potential exploitation. Regularly updating all Python dependencies and educating developers about secure package management practices will further reduce risk. Finally, integrating security scanning tools that detect vulnerable dependencies can help maintain ongoing security hygiene.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Italy, Spain
CVE-2024-6345: CWE-94 Improper Control of Generation of Code in pypa pypa/setuptools
Description
A vulnerability in the package_index module of pypa/setuptools versions up to 69.1.1 allows for remote code execution via its download functions. These functions, which are used to download packages from URLs provided by users or retrieved from package index servers, are susceptible to code injection. If these functions are exposed to user-controlled inputs, such as package URLs, they can execute arbitrary commands on the system. The issue is fixed in version 70.0.
AI-Powered Analysis
Technical Analysis
CVE-2024-6345 is a vulnerability classified under CWE-94 (Improper Control of Generation of Code) found in the pypa/setuptools package, a widely used Python package management tool. The flaw exists in the package_index module's download functions, which are responsible for fetching packages from URLs either provided directly by users or retrieved from package index servers. These functions fail to properly sanitize or validate the URLs, allowing an attacker to inject malicious code that gets executed on the host system. This remote code execution (RCE) vulnerability can be triggered without requiring authentication but does require user interaction, such as initiating a package installation or update process that involves a crafted URL. The vulnerability affects all setuptools versions up to 69.1.1 and has been addressed in version 70.0. The CVSS v3.0 score of 8.8 reflects the high impact on confidentiality, integrity, and availability, combined with the ease of exploitation due to network vector and low attack complexity. Although no exploits are currently known in the wild, the critical nature of setuptools in Python environments and its integration in development and deployment pipelines makes this vulnerability a significant threat. Attackers exploiting this flaw could execute arbitrary commands, potentially leading to full system compromise, data theft, or disruption of services.
Potential Impact
For European organizations, the impact of CVE-2024-6345 can be severe. Many enterprises, research institutions, and government agencies rely heavily on Python for software development, automation, and data analysis. The setuptools package is a fundamental tool in Python package management, often used in CI/CD pipelines, automated deployments, and development environments. Exploitation could lead to unauthorized code execution on build servers, developer workstations, or production systems, resulting in data breaches, insertion of malicious code into software supply chains, or disruption of critical services. The compromise of development infrastructure could also facilitate further attacks, including lateral movement within networks and persistence. Given the interconnected nature of European IT ecosystems and the reliance on open-source software, this vulnerability poses a systemic risk that could affect multiple sectors including finance, healthcare, manufacturing, and public administration.
Mitigation Recommendations
To mitigate this vulnerability, European organizations should immediately upgrade all instances of pypa/setuptools to version 70.0 or later, where the issue is fixed. Additionally, organizations should audit and restrict the sources of package URLs used in automated scripts, CI/CD pipelines, and manual installations to trusted repositories only. Implementing strict input validation and sanitization on any user-supplied URLs related to package downloads is critical to prevent injection attacks. Monitoring and logging package installation activities can help detect suspicious behavior early. Organizations should also consider isolating build and deployment environments to limit the impact of potential exploitation. Regularly updating all Python dependencies and educating developers about secure package management practices will further reduce risk. Finally, integrating security scanning tools that detect vulnerable dependencies can help maintain ongoing security hygiene.
Affected Countries
For access to advanced analysis and higher rate limits, contact root@offseq.com
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- @huntr_ai
- Date Reserved
- 2024-06-26T08:16:17.895Z
- Cvss Version
- 3.0
- State
- PUBLISHED
Threat ID: 690a2dfef0ba78a050538c81
Added to database: 11/4/2025, 4:46:54 PM
Last enriched: 11/4/2025, 4:52:32 PM
Last updated: 11/5/2025, 1:49:34 PM
Views: 2
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Related Threats
CVE-2025-12497: CWE-98 Improper Control of Filename for Include/Require Statement in PHP Program ('PHP Remote File Inclusion') in averta Premium Portfolio Features for Phlox theme
HighCVE-2025-11745: CWE-80 Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS) in spacetime Ad Inserter – Ad Manager & AdSense Ads
MediumCVE-2025-58337: CWE-284 Improper Access Control in Apache Software Foundation Apache Doris-MCP-Server
UnknownCVE-2025-12469: CWE-862 Missing Authorization in amans2k FunnelKit Automations – Email Marketing Automation and CRM for WordPress & WooCommerce
MediumCVE-2025-12468: CWE-200 Exposure of Sensitive Information to an Unauthorized Actor in amans2k FunnelKit Automations – Email Marketing Automation and CRM for WordPress & WooCommerce
MediumActions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.