Skip to main content

CVE-2025-8869: Vulnerability in Python Packaging Authority pip

Medium
VulnerabilityCVE-2025-8869cvecve-2025-8869
Published: Wed Sep 24 2025 (09/24/2025, 14:56:56 UTC)
Source: CVE Database V5
Vendor/Project: Python Packaging Authority
Product: pip

Description

When extracting a tar archive pip may not check symbolic links point into the extraction directory if the tarfile module doesn't implement PEP 706. Note that upgrading pip to a "fixed" version for this vulnerability doesn't fix all known vulnerabilities that are remediated by using a Python version that implements PEP 706. Note that this is a vulnerability in pip's fallback implementation of tar extraction for Python versions that don't implement PEP 706 and therefore are not secure to all vulnerabilities in the Python 'tarfile' module. If you're using a Python version that implements PEP 706 then pip doesn't use the "vulnerable" fallback code. Mitigations include upgrading to a version of pip that includes the fix, upgrading to a Python version that implements PEP 706 (Python >=3.9.17, >=3.10.12, >=3.11.4, or >=3.12), applying the linked patch, or inspecting source distributions (sdists) before installation as is already a best-practice.

AI-Powered Analysis

AILast updated: 09/25/2025, 00:10:15 UTC

Technical Analysis

CVE-2025-8869 is a medium-severity vulnerability affecting the Python Packaging Authority's pip tool, specifically in its fallback tar archive extraction implementation. The issue arises when pip extracts tar archives using a fallback method that does not properly verify whether symbolic links within the archive point inside the intended extraction directory. This vulnerability exists only in pip versions running on Python interpreters that do not implement PEP 706, which introduces secure tar extraction methods. Without PEP 706 support, pip's fallback extraction code can be tricked into following symbolic links that point outside the extraction directory, potentially allowing an attacker to overwrite arbitrary files on the filesystem during package installation. This could lead to privilege escalation or arbitrary code execution if malicious packages are installed. The vulnerability does not affect pip running on Python versions 3.9.17, 3.10.12, 3.11.4, 3.12 or later, as these versions implement PEP 706 and thus use a secure tar extraction method. Mitigations include upgrading pip to a version that includes the fix, upgrading Python to a version implementing PEP 706, applying available patches, or manually inspecting source distributions before installation. The CVSS 4.0 vector indicates the attack is network-based, requires no privileges, but requires user interaction (e.g., installing a malicious package), and impacts integrity highly but not confidentiality or availability. No known exploits are currently in the wild.

Potential Impact

For European organizations, this vulnerability poses a risk primarily to development and deployment environments that rely on pip for Python package management, especially those using older Python versions without PEP 706 support. An attacker could craft malicious Python packages containing specially crafted tar archives that exploit this vulnerability to overwrite critical files during installation. This could lead to unauthorized code execution, compromise of build pipelines, or tampering with deployed applications. Organizations with automated CI/CD pipelines that automatically install packages from untrusted or public sources are particularly at risk. The impact could extend to supply chain compromise and disruption of software delivery processes. Given Python's widespread use in European industries such as finance, telecommunications, and public sector, the vulnerability could affect a broad range of systems if not mitigated. However, the requirement for user interaction (installing a malicious package) limits remote exploitation without social engineering or supply chain compromise.

Mitigation Recommendations

European organizations should take the following specific steps: 1) Audit Python environments to identify versions older than 3.9.17, 3.10.12, 3.11.4, or 3.12 and plan upgrades to these or later versions that implement PEP 706. 2) Upgrade pip to the latest version that includes the fix for this vulnerability. 3) Implement strict controls on package sources, restricting installations to vetted internal repositories or trusted public repositories with package signing and verification. 4) Integrate manual or automated inspection of source distributions (sdists) before installation to detect suspicious symbolic links or archive structures. 5) Harden CI/CD pipelines by adding sandboxing or containerization to isolate package installation processes. 6) Monitor for unusual file modifications or privilege escalations following package installations. 7) Educate developers and DevOps teams about the risks of installing untrusted packages and the importance of upgrading Python and pip promptly.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
PSF
Date Reserved
2025-08-11T15:55:10.199Z
Cvss Version
4.0
State
PUBLISHED

Threat ID: 68d487f92f6beace9efc3584

Added to database: 9/25/2025, 12:08:25 AM

Last enriched: 9/25/2025, 12:10:15 AM

Last updated: 9/25/2025, 6:33:42 AM

Views: 5

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