CVE-2025-4330: Extraction filter bypass for linking outside extraction directory

Published Jun 3, 2025
·
Updated

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

Other sources

Extraction filter bypass for linking outside extraction directory

Microsoft

Affected Software

10 affected componentsFixes available
pypi/tarfile>3.12
IBM Cloud Pak System<=2.3.4.0
IBM Cloud Pak System<=2.3.4.1 2.3.4.1 ifix1
IBM Cloud Pak System<=2.3.5.0
IBM Cloud Pak System<=2.3.6.0
IBM OS Image for Red Hat Linux Systems<=4.0.4.0 4.0.5.0 4.0.6.0 4.0.7.0
IBM OS Image for Red Hat Linux Systems<=5.0.0.0 5.0.1.0
Microsoft cbl2 python3 3.9.19-13
Microsoft cbl2 python3 3.9.19-14
Microsoft azl3 python3 3.12.9-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Configuration

    When using Python's tarfile module to extract untrusted tar archives with TarFile.extractall() or TarFile.extract(), do NOT set the filter parameter to "data" or "tar". Use an extraction filter that prevents symlink targets from being linked outside the destination directory and avoids the related metadata modification risk.

    Python tarfile module TarFile.extractall()/TarFile.extract() filter parameter = use a restrictive extraction filter instead of "data" or "tar" when extracting untrusted tar archives
  2. Configuration

    For Python 3.14 or later, review usages of TarFile.extractall()/TarFile.extract() that rely on the default filter behavior: the default changed from "no filtering" to "data". If you extract untrusted tar archives and do not explicitly set a safe filter, your usage is affected.

    Python tarfile module default extraction filter (Python 3.14+) = ensure you account for filter default change from "no filtering" to "data"

Event History

Jun 3, 2025
CVE Published
via MITRE·12:58 PM
Data Sourced
via MITRE·12:58 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·01:15 PM
DescriptionSeverityWeakness
Data Sourced
via Red Hat·02:01 PM
DescriptionSeverityAffected Software
Jul 11, 2025
Data Sourced
via Microsoft·07:00 AM
DescriptionSeverityWeakness
Data Sourced
via Microsoft·07:00 AM
Affected Software
Updated
via Microsoft·07:00 AM
SeverityAffected Software
Updated
via Microsoft·07:00 AM
DescriptionSeverity
Jan 30, 2026
Data Sourced
via IBM·12:00 AM
DescriptionAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2025-4330?

CVE-2025-4330 is rated as a medium severity vulnerability due to its potential to allow unauthorized symlink manipulation.

2

How do I fix CVE-2025-4330?

To fix CVE-2025-4330, upgrade to a patched version of Python that addresses the vulnerability in the tarfile module.

3

What software is affected by CVE-2025-4330?

CVE-2025-4330 affects the Python software, particularly versions 3.12 and potentially below that utilize the tarfile module.

4

What are the consequences of exploiting CVE-2025-4330?

Exploiting CVE-2025-4330 allows an attacker to manipulate file metadata and create symlinks that point to arbitrary locations on the filesystem.

5

How can I mitigate the risks associated with CVE-2025-4330?

To mitigate the risks of CVE-2025-4330, avoid extracting untrusted tar archives or implement additional validation and sanitization on the extracted files.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203