ZeroHour

CVE-2026-87910

niche

CPython tarfile link-fallback ignores extraction filter rejection (filter bypass)

CVSS 4.0
5.7 medium
EPSS
Published
()
Modified
AI analysis

CVE-2026-87910 is a filter-bypass flaw in CPython's tarfile module: when tarfile extracts a hard or symbolic link on a filesystem that does not support links, it falls back to extracting the member the link points to, and the extraction filter is run twice, once for the extracted member and once with the name set to the link's location. In one of these two calls, a None return value, which is how a custom filter rejects or skips a member, was ignored, so a member the filter rejected could still be written to disk. An attacker who can supply a crafted tar archive could thereby extract members to locations the filter was intended to prevent, producing unintended or potentially traversing file placement (CWE-22, CWE-59; the CVSS 4.0 score of 5.7 reflects high integrity impact with no confidentiality or availability impact). Affected users are those running CPython and extracting archives with a custom extraction filter that rejects members via None on a filesystem without link support; the advisory data does not specify the affected version ranges. No public proof-of-concept, CISA KEV listing, or known exploitation has been reported.

What to do: Upgrade CPython to a release containing the fix for CVE-2026-87910 as soon as your vendor or distribution ships it, monitoring python.org security advisories for the patched versions. As an interim mitigation, do not rely on a custom extraction filter's None return to skip members when extracting archives containing hard or symbolic links on filesystems without link support, and audit code paths that call extract/extractall with user-controlled archives. After patching, review extraction destinations for members that should have been skipped.

Affected
Python Software Foundation CPython (tarfile module)
Estimated exposure
nicheLikely on the order of hundreds to a few thousand Python environments; no public telemetry quantifies custom extraction-filter usage on link-less filesystems — The trigger requires a rare combination, a custom tarfile extraction filter that rejects members by returning None plus extraction of a link on a filesystem lacking link support, so only a small slice of Python's very large install base is…

Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.

Description

When tarfile extracts a link on a system that doesn't support links, it falls back to extracting a member from the archive. In this case, the filter function is run twice: once for the extracted member, and once with name set to the location of the link. For one of the calls, the return value was ignored. Instead, the member should be skipped if either call returns None.

Weakness
CWE-22, CWE-59
Vector
CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:A/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

In the news

CPython: [CVE-2026-87910] tarfile hardlink fallback ignores custom extraction filter rejection via None

CPython CVE-2026-87910: tarfile's hardlink fallback ignores custom extraction filters that reject entries via None, rated MEDIUM severity.

Petr Viktorin disclosed CVE-2026-87910 on the CPython security-announce list, rated MEDIUM severity. The flaw is in the tarfile module: when a custom extraction filter rejects an entry by returning None, the hardlink fallback path ignores the rejection. The posted excerpt did not include affected versions or patch details.

oss-security · 4d agoVulnerabilityCVE-2026-879101