# CVE-2024-6232: Regular-expression DoS when parsing TarFile headers

> Attackers can cause denial of service in applications using Python's tarfile module by providing crafted tar archives that trigger excessive regex backtracking.

- **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:** 3 Sep 2024
- **Updated:** 3 Nov 2025
- **Also known as:** ALPINE-CVE-2024-6232, ALSA-2024:8359, ALSA-2024:8374, ALSA-2024:8446, ALSA-2024:8447, ALSA-2024:8836, ALSA-2024:8838, ALSA-2024:9450, ALSA-2024:9451, ALSA-2024:9468, AZL-109671, AZL-48552, AZL-48585, AZL-48740, BELL-CVE-2024-6232, BIT-libpython-2024-6232, BIT-python-2024-6232, BIT-python-min-2024-6232, CLEANSTART-2026-QV04553, CLSA-2024-1727289456, CLSA-2025-1740477793, DEBIAN-CVE-2024-6232, GHSA-mmm5-wgvp-wp8r, PSF-2024-11, RHSA-2024:7647, RHSA-2024:8130, RHSA-2024:8359, RHSA-2024:8374, RHSA-2024:8446, RHSA-2024:8447, RHSA-2024:8490, RHSA-2024:8504, RHSA-2024:8797, RHSA-2024:8836, RHSA-2024:8838, RHSA-2024:8977, RHSA-2024:9450, RHSA-2024:9451, RHSA-2024:9468, RHSA-2025:1750, RLSA-2024:8359, RLSA-2024:8374, RLSA-2024:8446, RLSA-2024:8447, RLSA-2024:8836, RLSA-2024:8838, SUSE-SU-2024:3430-1, SUSE-SU-2024:3447-1, UBUNTU-CVE-2024-6232, openSUSE-SU-2024:14327-1

## What is CVE-2024-6232?

CVE-2024-6232 is a high-severity denial of service vulnerability in Python Python, published on 3 Sep 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

There is a MEDIUM severity vulnerability affecting CPython.

Regular expressions that allowed excessive backtracking during tarfile.TarFile header parsing are vulnerable to ReDoS via specifically-crafted tar archives.

Weakness: CWE-1333 (Inefficient Regular Expression Complexity)

## Which versions are affected by CVE-2024-6232?

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `libpython` | Bitnami | All versions | 3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.6 |
| `python` | Bitnami | All versions | 3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.6 |
| `python-min` | Bitnami | All versions | 3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.6 |
| `python3.11` | AlmaLinux:8 | All versions | 3.11.10-1.el8_10 |
| `python3.11-debug` | AlmaLinux:8 | All versions | 3.11.10-1.el8_10 |
| `python3.11-devel` | AlmaLinux:8 | All versions | 3.11.10-1.el8_10 |
| `python3.11-idle` | AlmaLinux:8 | All versions | 3.11.10-1.el8_10 |
| `python3.11-libs` | AlmaLinux:8 | All versions | 3.11.10-1.el8_10 |
| `python3.11-rpm-macros` | AlmaLinux:8 | All versions | 3.11.10-1.el8_10 |
| `python3.11-test` | AlmaLinux:8 | All versions | 3.11.10-1.el8_10 |
| `python3.11-tkinter` | AlmaLinux:8 | All versions | 3.11.10-1.el8_10 |
| `python3.12` | AlmaLinux:8 | All versions | 3.12.6-1.el8_10 |
| `python3.12-debug` | AlmaLinux:8 | All versions | 3.12.6-1.el8_10 |
| `python3.12-devel` | AlmaLinux:8 | All versions | 3.12.6-1.el8_10 |
| `python3.12-idle` | AlmaLinux:8 | All versions | 3.12.6-1.el8_10 |
| `python3.12-libs` | AlmaLinux:8 | All versions | 3.12.6-1.el8_10 |
| `python3.12-rpm-macros` | AlmaLinux:8 | All versions | 3.12.6-1.el8_10 |
| `python3.12-test` | AlmaLinux:8 | All versions | 3.12.6-1.el8_10 |
| `python3.12-tkinter` | AlmaLinux:8 | All versions | 3.12.6-1.el8_10 |
| `python39` | AlmaLinux:8 | All versions | 3.9.20-1.module_el8.10.0+3902+1690be06 |
| `python39-Cython` | AlmaLinux:8 | All versions | 0.29.21-5.module_el8.6.0+2780+a40f65e1 |
| `python39-Cython` | AlmaLinux:8 | All versions | 0.29.21-5.module_el8.6.0+3248+c431e88c |
| `python39-PyMySQL` | AlmaLinux:8 | All versions | 0.10.1-2.module_el8.6.0+2780+a40f65e1 |
| `python39-attrs` | AlmaLinux:8 | All versions | 20.3.0-2.module_el8.6.0+2780+a40f65e1 |
| `python39-cffi` | AlmaLinux:8 | All versions | 1.14.3-2.module_el8.6.0+2780+a40f65e1 |
| `python39-cffi` | AlmaLinux:8 | All versions | 1.14.3-2.module_el8.6.0+3248+c431e88c |
| `python39-chardet` | AlmaLinux:8 | All versions | 3.0.4-19.module_el8.6.0+2780+a40f65e1 |
| `python39-cryptography` | AlmaLinux:8 | All versions | 3.3.1-3.module_el8.10.0+3765+2f9a457d |
| `python39-debug` | AlmaLinux:8 | All versions | 3.9.20-1.module_el8.10.0+3902+1690be06 |
| `python39-devel` | AlmaLinux:8 | All versions | 3.9.20-1.module_el8.10.0+3902+1690be06 |
| `python39-idle` | AlmaLinux:8 | All versions | 3.9.20-1.module_el8.10.0+3902+1690be06 |
| `python39-idna` | AlmaLinux:8 | All versions | 2.10-4.module_el8.10.0+3849+a48d89aa |
| `python39-iniconfig` | AlmaLinux:8 | All versions | 1.1.1-2.module_el8.6.0+2780+a40f65e1 |
| `python39-libs` | AlmaLinux:8 | All versions | 3.9.20-1.module_el8.10.0+3902+1690be06 |
| `python39-lxml` | AlmaLinux:8 | All versions | 4.6.5-1.module_el8.6.0+2780+a40f65e1 |
| `python39-lxml` | AlmaLinux:8 | All versions | 4.6.5-1.module_el8.6.0+3248+c431e88c |
| `python39-mod_wsgi` | AlmaLinux:8 | All versions | 4.7.1-7.module_el8.9.0+3634+fb2a896c |
| `python39-more-itertools` | AlmaLinux:8 | All versions | 8.5.0-2.module_el8.6.0+2780+a40f65e1 |
| `python39-numpy` | AlmaLinux:8 | All versions | 1.19.4-3.module_el8.6.0+2780+a40f65e1 |
| `python39-numpy` | AlmaLinux:8 | All versions | 1.19.4-3.module_el8.6.0+3248+c431e88c |

Products: Python Python.

## How do I fix CVE-2024-6232?

Upgrade libpython to a fixed version for your release line: 3.8.20, 3.9.20, 3.10.15 or 3.11.10.

## Is CVE-2024-6232 being exploited?

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

Public exploit code:

- Exploit for CVE-2024-6232 - Python Tarfile Realpath Overflow (github_poc): https://github.com/bgutowski/CVE-2025-4517-POC-Sudoers

## Other vulnerabilities in Python Python

- [CVE-2008-5031](https://insights.sbomify.com/CVE-2008-5031/): Integer overflow in n/a (critical 10.0)
- [CVE-2014-4650](https://insights.sbomify.com/CVE-2014-4650/): Path traversal in n/a (critical 9.8)
- [CVE-2016-5636](https://insights.sbomify.com/CVE-2016-5636/): Integer overflow in n/a (critical 9.8)
- [CVE-2007-4559](https://insights.sbomify.com/CVE-2007-4559/): Path traversal in n/a (critical 9.8)
- [CVE-2017-17522](https://insights.sbomify.com/CVE-2017-17522/): Command injection in n/a (high 8.8)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-6232 and fix it if it is affected.

What it is: CVE-2024-6232 is a high-severity denial of service vulnerability in Python Python, published on 3 Sep 2024. 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-2024-6232 in the wild and no public exploit code.

Affected packages and fixed versions:
- libpython (Bitnami): affected all versions; fixed in 3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.6
- python (Bitnami): affected all versions; fixed in 3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.6
- python-min (Bitnami): affected all versions; fixed in 3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.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-2024-6232/ (Markdown: https://insights.sbomify.com/CVE-2024-6232/index.md)
```

## Sources

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

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