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

High 7.5 Published Updated

Attackers can bypass extraction filters to create symlinks outside the target directory, potentially modifying files or metadata.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2025-4330?

CVE-2025-4330 is a high-severity path traversal vulnerability in CPython, published on 3 Jun 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

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.

Weakness: CWE-22

Which versions are affected by CVE-2025-4330?

3 open source packages ship an affected version, including libpython, python and python-min.

PackageAffectedFixed in
libpython BitnamiAll versions3.9.23, 3.10.18, 3.11.13, 3.12.11, 3.13.4
python BitnamiAll versions3.9.23, 3.10.18, 3.11.13, 3.12.11, 3.13.4
python-min BitnamiAll versions3.9.23, 3.10.18, 3.11.13, 3.12.11, 3.13.4

How do I fix CVE-2025-4330?

Upgrade libpython to a fixed version for your release line: 3.9.23, 3.10.18, 3.11.13 or 3.12.11.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is CVE-2025-4330 being exploited?

There is no known exploitation of CVE-2025-4330 in the wild and no public exploit code.

Sources

Also known as ALPINE-CVE-2025-4330, AZL-62313, BELL-CVE-2025-4330, BIT-libpython-2025-4330, BIT-python-2025-4330, BIT-python-min-2025-4330 and 10 more.

Is CVE-2025-4330 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free