CVE-2025-8869: Pip Pip's Fallback Tar Extraction Doesn't Vulnerability

MODERATE
Advisory Identifier: GHSA-4xh5-x5gv-qwph
CWE-59
Published
Advisory Summary

CVE-2025-8869 is a MODERATE pip's fallback tar extraction doesn't vulnerability (CWE-59: Improper Link Resolution Before File Access ('Link Following')) affecting Pip libraries in the PyPI ecosystem. The issue involves pip's fallback tar extraction doesn't check symbolic links point to extraction directory. Remediation is available by upgrading affected packages to version 25.3.

CVE-2025-8869 at a Glance

CVE Identifier CVE-2025-8869
GHSA Identifier GHSA-4xh5-x5gv-qwph
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-59: Improper Link Resolution Before File Access ('Link Following')
Affected Product Pip
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix CVE-2025-8869

To remediate this vulnerability, upgrade all affected Pip dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

pip fixed: 25.3
pip install pip>=25.3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show pip

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2025-8869, inspect your installed packages using pip:

pip show pip

Analyze the terminal output to locate any version of Pip in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 25.3), your application is affected.

Note: The pip show pip command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-59: Improper Link Resolution Before File Access ('Link Following'), where the product attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource. In Pip, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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.

CVE-2025-8869 Affected Pip Versions

1 component(s)
Fixed Versions:
25.3
Product / Package Ecosystem Affected Versions Fixed Version
pip
PyPI
< 25.3
25.3

References

Frequently Asked Questions

What is CVE-2025-8869?
CVE-2025-8869 is a security vulnerability in Pip involving pip's fallback tar extraction doesn't check symbolic links point to extraction directory under CWE-59: Improper Link Resolution Before File Access ('Link Following').
Which Pip versions are affected?
Affected versions include releases prior to 25.3 across affected packages: pip.
What version fixes CVE-2025-8869?
Upgrading to 25.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is pip affected?
Yes, pip is affected in releases prior to 25.3. Upgrade your dependency to 25.3 or later.
What CWE is associated with CVE-2025-8869?
CVE-2025-8869 is classified under CWE-59: Improper Link Resolution Before File Access ('Link Following') (The product attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource.).
How can I check PyPI dependencies for CVE-2025-8869?
Run the dependency tree command: 'pip show pip'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-4xh5-x5gv-qwph",
  "modified" : "2025-12-19T16:46:01Z",
  "published" : "2025-09-24T15:31:14Z",
  "aliases" : [ "CVE-2025-8869" ],
  "summary" : "pip's fallback tar extraction doesn't check symbolic links point to extraction directory",
  "details" : "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.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "pip"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "25.3"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 25.2"
    }
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-8869"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/pip/pull/13550"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/pip/commit/f2b92314da012b9fffa36b3f3e67748a37ef464a"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/pypa/pip"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2025/10/msg00028.html"
  }, {
    "type" : "WEB",
    "url" : "https://mail.python.org/archives/list/security-announce@python.org/thread/IF5A3GCJY3VH7BVHJKOWOJFKTW7VFQEN"
  }, {
    "type" : "WEB",
    "url" : "https://pip.pypa.io/en/stable/news/#v25-2"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-59" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-09-24T20:04:58Z",
    "nvd_published_at" : "2025-09-24T15:15:41Z"
  }
}