CVE-2025-8869
ADVISORY - githubSummary
Summary
In the fallback extraction path for source distributions, pip used Python’s tarfile module without verifying that symbolic/hard link targets resolve inside the intended extraction directory. A malicious sdist can include links that escape the target directory and overwrite arbitrary files on the invoking host during pip install.
Impact
Successful exploitation enables arbitrary file overwrite outside the build/extraction directory on the machine running pip. This can be leveraged to tamper with configuration or startup files and may lead to further code execution depending on the environment, but the direct, guaranteed impact is integrity compromise on the vulnerable system.
Conditions
The issue is triggered when installing an attacker-controlled sdist (e.g., from an index or URL) and the fallback extraction code path is used. No special privileges are required beyond running pip install; active user action is necessary.
Remediation
The fix is available starting in pip 25.3. Using a Python interpreter that implements the safe-extraction behavior described by PEP 706 provides additional defense in depth for other tarfile issues but is not a substitute for upgrading pip for this specific flaw.
Common Weakness Enumeration (CWE)
Improper Link Resolution Before File Access ('Link Following')
NIST
-
CVSS SCORE
5.9mediumGitHub
-
CVSS SCORE
5.9mediumDebian
-
Ubuntu
-
CVSS SCORE
N/AmediumAmazon
-
CVSS SCORE
N/AmediumAmazon
-
CVSS SCORE
N/AmediumAmazon
-
CVSS SCORE
N/AmediumBitnami
BIT-pip-2025-8869
-
CVSS SCORE
5.9mediumChainguard
CGA-c9gp-h88w-m4xj
-
Chainguard
CGA-g478-cr5w-6x9w
-
Chainguard
CGA-gp9x-pvp4-9f35
-
Chainguard
CGA-hmx9-f954-2x8m
-
Chainguard
CGA-hvw2-h335-ff54
-
Chainguard
CGA-m555-hgfj-qhhh
-
Chainguard
CGA-q45g-v9pp-5ccp
-
Chainguard
CGA-q93x-p4mh-5338
-
Chainguard
CGA-vv4w-2v56-2r2g
-
minimos
MINI-3r75-2w72-gmff
-
minimos
MINI-5r44-6qpw-34vc
-
minimos
MINI-f9cq-mwg9-63ww
-
minimos
MINI-j6ww-7529-624g
-
minimos
MINI-j96j-jmq5-jp6m
-
minimos
MINI-m28w-xvw5-pv5r
-