Symlink Vulnerability in Python 3.12 and 3.13 Packages

python3.12 Updated 03 Oct 2025

Summary

03/06/2025
N/A
Yes i
High
7.5

UBUNTU-CVE-2025-4330: Allows the extraction filter to be ignored, allowing symlink targets to point outside the destination directory, and the modification of some file metadata. Affects python3.12 versions < 3.12.3-1ubuntu0.7. Fixed in 3.12.3-1ubuntu0.7. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Python is a widely-used high-level programming language known for its readability and versatility. The affected packages, python3.12 and python3.13, are implementations of Python 3.12 and 3.13, respectively, on Ubuntu systems. These packages provide essential tools for developers to create and run Python applications. However, a recently discovered vulnerability allows for the extraction filter to be ignored when using the tarfile module, posing a risk to file integrity and security.

Vulnerability Detail

The vulnerability, identified as CVE-2025-4330, allows the tarfile extraction filter to be bypassed, enabling symlink targets to point outside the intended destination directory. This can lead to unauthorized modification of file metadata and potential security breaches when extracting untrusted tar archives. The issue arises when using TarFile.extractall() or TarFile.extract() with the filter parameter set to 'data' or 'tar'. Notably, Python 3.14 and later versions have changed the default filter behavior, which may inadvertently expose users to this vulnerability if they rely on the new default settings.

How To Fix

Minimum fixed version

3.12.3-1ubuntu0.7

This is the first release that contains the fix.

sudo apt-get install --only-upgrade python3.12

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, avoid using the tarfile module to extract untrusted tar archives, especially with the filter parameter set to 'data' or 'tar'. Instead, consider using alternative methods for extracting archives or ensure that the archives are from trusted sources.

Conclusion

The CVE-2025-4330 vulnerability in Python 3.12 and 3.13 packages poses significant risks when extracting untrusted tar archives. Users are advised to update their packages to the latest patched versions to mitigate these risks. For those unable to update immediately, alternative extraction methods should be employed to ensure security.

See every vulnerability recorded for python3.12 →

Share this vulnerability

FAQ

CVE-2025-4330 is a vulnerability in the Python tarfile module that allows symlink targets to point outside the destination directory, potentially compromising file integrity.

You can check if your application is affected by using the Vulert playground at Vulert Scanner, which analyzes your manifest file for vulnerabilities.

The risks include unauthorized access to files, modification of file metadata, and potential security breaches when extracting untrusted tar archives.

Yes, patched versions of the affected packages are available. Users should update to python3.12 version 3.12.3-1ubuntu0.7 or python3.13 version 3.13.3-1ubuntu0.2.

If immediate updates are not possible, avoid using the tarfile module for untrusted archives and consider using alternative extraction methods.

Related vulnerabilities

Recent vulnerabilities recorded for python3.12.

How To Fix

Minimum fixed version

3.12.3-1ubuntu0.7

This is the first release that contains the fix.

sudo apt-get install --only-upgrade python3.12

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback