# CVE-2025-4435: Tarfile extracts filtered members when errorlevel=0

> Attackers can bypass tarfile extraction filters when errorlevel is set to 0, potentially writing files to unintended locations.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 3 Jun 2025
- **Updated:** 31 Jul 2026
- **Also known as:** AZL-62298, BELL-CVE-2025-4435, BIT-libpython-2025-4435, BIT-python-2025-4435, BIT-python-min-2025-4435, DEBIAN-CVE-2025-4435, ECHO-8b45-3518-603b, GHSA-p72v-37h5-753v, MINI-3rpc-52rh-wv5x, MINI-rc4m-2452-vc27, MINI-w89c-v6mh-86jm, MINI-w8cf-m39w-8m59, PSF-2025-8, UBUNTU-CVE-2025-4435

## What is CVE-2025-4435?

CVE-2025-4435 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

When using a TarFile.errorlevel = 0 and extracting with a filter the documented behavior is that any filtered members would be skipped and not extracted. However the actual behavior of TarFile.errorlevel = 0 in affected versions is that the member would still be extracted and not skipped.

Weakness: CWE-682 (Incorrect Calculation)

## Which versions are affected by CVE-2025-4435?

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `libpython` | Bitnami | All versions | 3.9.23, 3.10.18, 3.11.13, 3.12.11, 3.13.4 |
| `python` | Bitnami | All versions | 3.9.23, 3.10.18, 3.11.13, 3.12.11, 3.13.4 |
| `python-min` | Bitnami | All versions | 3.9.23, 3.10.18, 3.11.13, 3.12.11, 3.13.4 |

## How do I fix CVE-2025-4435?

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

## Is CVE-2025-4435 being exploited?

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

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-4435 and fix it if it is affected.

What it is: CVE-2025-4435 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.
Exploitation: There is no known exploitation of CVE-2025-4435 in the wild and no public exploit code.

Affected packages and fixed versions:
- libpython (Bitnami): affected all versions; fixed in 3.9.23, 3.10.18, 3.11.13, 3.12.11, 3.13.4
- python (Bitnami): affected all versions; fixed in 3.9.23, 3.10.18, 3.11.13, 3.12.11, 3.13.4
- python-min (Bitnami): affected all versions; fixed in 3.9.23, 3.10.18, 3.11.13, 3.12.11, 3.13.4

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-4435/ (Markdown: https://insights.sbomify.com/CVE-2025-4435/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-4435
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-4435
- OSV: https://osv.dev/vulnerability/CVE-2025-4435

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-4435/
Summaries are generated and may contain mistakes; the official description above is the record.
