# CVE-2025-8194: Tarfile infinite loop during parsing with negative member offset

> Attackers can cause a denial of service via infinite loop in Python's tarfile module by providing maliciously crafted archives with negative offsets.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 28 Jul 2025
- **Updated:** 31 Jul 2026
- **Also known as:** ALSA-2025:14546, ALSA-2025:14560, ALSA-2025:14841, ALSA-2025:14984, ALSA-2025:15007, ALSA-2025:15010, ALSA-2025:15019, AZL-65984, AZL-65987, BELL-CVE-2025-8194, BIT-libpython-2025-8194, BIT-python-2025-8194, BIT-python-min-2025-8194, CLSA-2025-1757500267, CLSA-2025-1757945157, CLSA-2025-1758101854, CLSA-2025-1758101956, CLSA-2025-1759246699, CLSA-2025-1759248934, CLSA-2025-1760982776, CLSA-2025-1760983006, CLSA-2025-1760987651, CLSA-2025-1763033745, CLSA-2025-1763033941, CLSA-2025-1763054281, CLSA-2026-1772576551, CLSA-2026-1772577130, CLSA-2026-1772810768, DEBIAN-CVE-2025-8194, ECHO-053d-4507-0279, GHSA-v594-44hm-2j7p, MINI-3p7v-gq39-844r, MINI-597w-2h7h-wvg8, MINI-crg4-5g4j-62hf, MINI-mwf4-qfwx-7gh4, OESA-2025-2100, OESA-2025-2101, OESA-2025-2102, OESA-2025-2103, PSF-2025-11, RHSA-2025:14546, RHSA-2025:14560, RHSA-2025:14841, RHSA-2025:14984, RHSA-2025:15007, RHSA-2025:15010, RHSA-2025:15019, RHSA-2025:15348, RHSA-2025:15724, RHSA-2025:15800, RHSA-2025:15968, RHSA-2025:16012, RHSA-2025:16016, RHSA-2025:16031, RHSA-2025:16062, RHSA-2025:16078, RHSA-2025:16117, RHSA-2025:16118, RHSA-2025:16151, RHSA-2025:16152, RHSA-2025:16153, RHSA-2025:16262, RLSA-2025:14546, RLSA-2025:14560, RLSA-2025:14841, RLSA-2025:14984, RLSA-2025:15007, RLSA-2025:15010, RLSA-2025:15019, ROOT-OS-UBUNTU-2204-CVE-2025-8194, SUSE-SU-2025:02700-1, SUSE-SU-2025:02701-1, SUSE-SU-2025:02787-1, SUSE-SU-2025:02948-1, SUSE-SU-2025:02982-1, SUSE-SU-2025:02983-1, SUSE-SU-2025:02984-1, SUSE-SU-2025:03032-1, SUSE-SU-2025:20631-1, SUSE-SU-2025:20749-1, UBUNTU-CVE-2025-8194, USN-7710-2, openSUSE-SU-2025:15402-1, openSUSE-SU-2025:15403-1, openSUSE-SU-2025:15404-1, openSUSE-SU-2025:15407-1, openSUSE-SU-2025:15408-1, openSUSE-SU-2025:15409-1

## What is CVE-2025-8194?

CVE-2025-8194 is a high-severity denial of service vulnerability in CPython, published on 28 Jul 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

There is a defect in the CPython “tarfile” module affecting the “TarFile” extraction and entry enumeration APIs. The tar implementation would process tar archives with negative offsets without error, resulting in an infinite loop and deadlock during the parsing of maliciously crafted tar archives. 

This vulnerability can be mitigated by including the following patch after importing the “tarfile” module:  https://gist.github.com/sethmlarson/1716ac5b82b73dbcbf23ad2eff8b33e1

Weakness: CWE-835 (Loop with Unreachable Exit Condition)

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

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.24, 3.10.19, 3.11.14, 3.12.12, 3.13.6 |
| `python` | Bitnami | All versions | 3.9.24, 3.10.19, 3.11.14, 3.12.12, 3.13.6 |
| `python-min` | Bitnami | All versions | 3.9.24, 3.10.19, 3.11.14, 3.12.12, 3.13.6 |
| `python-unversioned-command` | AlmaLinux:10 | All versions | 3.12.9-2.el10_0.3 |
| `platform-python` | AlmaLinux:8 | All versions | 3.6.8-71.el8_10.alma.1 |
| `platform-python-debug` | AlmaLinux:8 | All versions | 3.6.8-71.el8_10.alma.1 |
| `platform-python-devel` | AlmaLinux:8 | All versions | 3.6.8-71.el8_10.alma.1 |
| `python3-idle` | AlmaLinux:8 | All versions | 3.6.8-71.el8_10.alma.1 |
| `python3-libs` | AlmaLinux:8 | All versions | 3.6.8-71.el8_10.alma.1 |
| `python3-test` | AlmaLinux:8 | All versions | 3.6.8-71.el8_10.alma.1 |
| `python3-tkinter` | AlmaLinux:8 | All versions | 3.6.8-71.el8_10.alma.1 |
| `python3.11` | AlmaLinux:8 | All versions | 3.11.13-2.el8_10 |
| `python3.11-debug` | AlmaLinux:8 | All versions | 3.11.13-2.el8_10 |
| `python3.11-devel` | AlmaLinux:8 | All versions | 3.11.13-2.el8_10 |
| `python3.11-idle` | AlmaLinux:8 | All versions | 3.11.13-2.el8_10 |
| `python3.11-libs` | AlmaLinux:8 | All versions | 3.11.13-2.el8_10 |
| `python3.11-rpm-macros` | AlmaLinux:8 | All versions | 3.11.13-2.el8_10 |
| `python3.11-test` | AlmaLinux:8 | All versions | 3.11.13-2.el8_10 |
| `python3.11-tkinter` | AlmaLinux:8 | All versions | 3.11.13-2.el8_10 |
| `python3.12` | AlmaLinux:8 | All versions | 3.12.11-2.el8_10 |
| `python3.12-debug` | AlmaLinux:8 | All versions | 3.12.11-2.el8_10 |
| `python3.12-devel` | AlmaLinux:8 | All versions | 3.12.11-2.el8_10 |
| `python3.12-idle` | AlmaLinux:8 | All versions | 3.12.11-2.el8_10 |
| `python3.12-libs` | AlmaLinux:8 | All versions | 3.12.11-2.el8_10 |
| `python3.12-rpm-macros` | AlmaLinux:8 | All versions | 3.12.11-2.el8_10 |
| `python3.12-test` | AlmaLinux:8 | All versions | 3.12.11-2.el8_10 |
| `python3.12-tkinter` | AlmaLinux:8 | All versions | 3.12.11-2.el8_10 |
| `python-unversioned-command` | AlmaLinux:9 | All versions | 3.9.21-2.el9_6.2 |
| `python3` | AlmaLinux:9 | All versions | 3.9.21-2.el9_6.2 |
| `python3-debug` | AlmaLinux:9 | All versions | 3.9.21-2.el9_6.2 |
| `python3-devel` | AlmaLinux:9 | All versions | 3.9.21-2.el9_6.2 |
| `python3-idle` | AlmaLinux:9 | All versions | 3.9.21-2.el9_6.2 |
| `python3-libs` | AlmaLinux:9 | All versions | 3.9.21-2.el9_6.2 |
| `python3-test` | AlmaLinux:9 | All versions | 3.9.21-2.el9_6.2 |
| `python3-tkinter` | AlmaLinux:9 | All versions | 3.9.21-2.el9_6.2 |
| `python3.11` | AlmaLinux:9 | All versions | 3.11.11-2.el9_6.2 |
| `python3.11-debug` | AlmaLinux:9 | All versions | 3.11.11-2.el9_6.2 |
| `python3.11-devel` | AlmaLinux:9 | All versions | 3.11.11-2.el9_6.2 |
| `python3.11-idle` | AlmaLinux:9 | All versions | 3.11.11-2.el9_6.2 |
| `python3.11-libs` | AlmaLinux:9 | All versions | 3.11.11-2.el9_6.2 |

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

Upgrade libpython to a fixed version for your release line: 3.9.24, 3.10.19, 3.11.14 or 3.12.12.

## Is CVE-2025-8194 being exploited?

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

## Fix prompt for AI coding agents

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

What it is: CVE-2025-8194 is a high-severity denial of service vulnerability in CPython, published on 28 Jul 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-8194 in the wild and no public exploit code.

Affected packages and fixed versions:
- libpython (Bitnami): affected all versions; fixed in 3.9.24, 3.10.19, 3.11.14, 3.12.12, 3.13.6
- python (Bitnami): affected all versions; fixed in 3.9.24, 3.10.19, 3.11.14, 3.12.12, 3.13.6
- python-min (Bitnami): affected all versions; fixed in 3.9.24, 3.10.19, 3.11.14, 3.12.12, 3.13.6

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-8194/ (Markdown: https://insights.sbomify.com/CVE-2025-8194/index.md)
```

## Sources

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

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