LiveActive security incident?Get immediate response
CVE Record

CVE-2025-4138: Bypassing extraction filter to create symlinks to arbitrary targets outside extraction directory

Allows the extraction filter to be ignored, allowing symlink targets to point outside the destination directory, and the modification of some file metadata. You are affected by this vulnerability if using the tarfile module to extract untrusted tar archives using TarFile.extractall() or TarFile.extract() using the filter= parameter with a value of "data" or "tar". See the tarfile extraction filters documentation https://docs.python.org/3/library/tarfile.html#tarfile-extraction-filter  for more information. Note that for Python 3.14 or later the default value of filter= changed from "no filtering" to `"data", so if you are relying on this new default behavior then your usage is also affected. Note that none of these vulnerabilities significantly affect the installation of source distributions which are tar archives as source distributions already allow arbitrary code execution during the build process. However when evaluating source distributions it's important to avoid installing source distributions with suspicious links.

HighCVSS 7.5Not KEV-listedUpdated
Glexia's TakeAutomated analysishigh

Security readout for executives and security teams

Plain-English summary

A malicious TAR archive can bypass Python’s intended extraction protections by creating symbolic links that point outside the chosen destination. This breaks the expected containment boundary and may expose sensitive files. Risk exists only where applications extract untrusted archives through the affected tarfile interfaces.

Executive priority

Treat this as urgent where public or otherwise untrusted TAR files are processed. Elsewhere, complete exposure inventory promptly and remediate within the normal high-severity window. The absence of confirmed exploitation lowers immediate incident-response urgency, but it does not reduce risk for exposed extraction services.

Technical view

CVE-2025-4138 affects CPython tarfile extraction using TarFile.extractall() or TarFile.extract() with filter="data" or filter="tar". Crafted symlink targets can escape the destination directory, and some file metadata can be modified. Python 3.14’s default "data" filter is also affected. The supplied CVSS 3.1 score is 7.5, emphasizing confidentiality impact.

Likely exposure

Exposure is concentrated in applications that extract untrusted TAR archives using the affected calls and filters. Python 3.14 users relying on the new default filter may also be exposed. Applications that do not process untrusted TAR archives through these paths are unlikely to be affected.

Exploitation context

The supplied record does not list this CVE in KEV and provides no evidence of active exploitation. Its CVSS vector describes network reachability, low complexity, no required privileges, and no user interaction, but practical exploitation still requires an application to extract an attacker-controlled archive through an affected path.

Researcher notes

The structured affected data names specific CPython versions but does not provide clear fixed-release boundaries; its default status is unaffected. Avoid generalizing entire release branches without consulting vendor guidance. Review the linked issue, patch, commits, and mitigation for branch-specific behavior. Source-distribution installation is not materially worsened because builds already permit arbitrary code execution.

Mitigation direction

  • Inventory applications using TarFile.extractall() or TarFile.extract() on untrusted archives.
  • Upgrade affected CPython runtimes to fixed releases identified by Python’s security guidance.
  • Until upgraded, avoid processing untrusted TAR archives through affected extraction paths.
  • Review the cited vendor mitigation before implementing temporary application-level controls.

Validation and detection

  • Record Python versions for every workload that extracts untrusted TAR archives.
  • Search application code for affected extraction calls, filters, and trust boundaries.
  • Confirm fixed-version applicability against the Python advisory because this bundle lacks precise fixed-release mapping.
  • Run non-destructive regression tests confirming extraction cannot create symlink targets outside the destination.
Prepared
Confidence
medium
Sources
7

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cwe · medium confidence lookup

CWE-22: File access and web shell behavior lookup

File traversal and upload weaknesses can lead teams to review file, web shell, execution, and collection telemetry. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
description · low confidence lookup

Execution behavior lookup

The CVE wording references code or command execution, so execution technique review may help defensive triage. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2025-4138 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
High
CVSS
7.5 (3.1)
Known Exploited
No
Published

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

1CVSS vectors
3Timeline events
1ADP providers
13Source links

SSVC decision data

CISA-ADPCISA Coordinator
Timestamp
Version
2.0.3
Exploitation: noneAutomatable: yesTechnical Impact: partial

CVSS vector scores

1 official score

We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.

ScoreVersionSeverityVectorExploitImpactSource
7.5CVSS 3.1HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N3.93.6PSF

Vulnerability scoring details

Base CVSS 3.1 score

7.5High
CVSS 3.1 vector shape for CVE-2025-4138Attack VectorAttack ComplexityPrivileges RequiredUser InteractionScopeConfidentiality ImpactIntegrity ImpactAvailability Impact

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Privileges Required
NoneLowHigh
User Interaction
NoneRequired
Scope
ChangedUnchanged
Confidentiality Impact
HighLowNone
Integrity Impact
HighLowNone
Availability Impact
HighLowNone

Vulnerability timeline

Timeline events are normalized from CVE metadata, CNA source timelines, ADP timelines, and KEV metadata when present.

  1. CVE reservedCVE Program

    The CVE ID was reserved by the assigning CNA.

  2. CVE publishedCVE Program

    The CVE record was published.

  3. CVE updatedCVE Program

    The CVE record metadata indicates this as the latest update time.

ADP provider summaries

CISA-ADPCISA ADP Vulnrichment
other:ssvc
Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
Python Software FoundationCPython0, 3.10.0, 3.11.0, 3.12.0, 3.13.0, 3.14.0a1unaffected
Weakness

CWE details

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.

CWE-22 · source CWE mapping

Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.