CVE-2024-6232·Python vulnerability
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.
- Severity
- high
- Software
- Python
- Fixed in
- 3.12.6
- Published
- 2024-09-03
Affected versions
From: 3.12.0
Until: 3.12.6
Fixed in: 3.12.6
How to fix this CVE
Update Python 3.12 to version 3.12.6 or later to patch a regular expression denial-of-service (ReDoS) vulnerability in tarfile header parsing. Maliciously crafted tar archives can trigger excessive backtracking in regex processing, causing denial of service. Prioritize this update for systems that process untrusted tar files or expose tarfile functionality to external input.
sudo dnf update python3Defensia detects this vulnerability
How to check if you are affected
- Check installed Python version: python3 --version
- Verify if tarfile module is actively used: grep -r "tarfile\|TarFile" /opt /srv /home --include='*.py' 2>/dev/null
- Search system logs for tar extraction errors: grep -i 'tarfile\|tar.*error\|regex' /var/log/syslog /var/log/messages 2>/dev/null | head -20
- Confirm the patch: python3 -c "import tarfile; print(tarfile.__file__)" and verify Python version is 3.12.6+
FAQ
What is CVE-2024-6232?
CVE-2024-6232 is a regular expression denial-of-service (ReDoS) vulnerability in Python's tarfile module. Specifically crafted tar archive headers can cause excessive regex backtracking during parsing, resulting in CPU exhaustion and service unavailability.
Is CVE-2024-6232 being actively exploited?
No. According to CISA data, CVE-2024-6232 is not currently listed in the Known Exploited Vulnerabilities catalog, and no public exploits are available.
What versions of Python are affected by CVE-2024-6232?
Python versions 3.12.0 through 3.12.6 are vulnerable. The vulnerability is fixed in Python 3.12.6 and later.
How do I check if my server is vulnerable to CVE-2024-6232?
Run python3 --version and compare the output to 3.12.6. If the version is 3.12.5 or earlier in the 3.12.x series, your server is vulnerable.
Does Defensia detect CVE-2024-6232?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If Python 3.12.0–3.12.5 is detected on a monitored server, CVE-2024-6232 will appear in your dashboard with remediation steps.
Related Python CVEs
References
- https://github.com/python/cpython/commit/34ddb64d088dd7ccc321f6103d23153256caa5d4
- https://github.com/python/cpython/commit/4eaf4891c12589e3c7bdad5f5b076e4c8392dd06
- https://github.com/python/cpython/commit/743acbe872485dc18df4d8ab2dc7895187f062c4
- https://github.com/python/cpython/commit/7d1f50cd92ff7e10a1c15a8f591dde8a6843a64d
- https://github.com/python/cpython/commit/b4225ca91547aa97ed3aca391614afbb255bc877
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2024-6232. Free for 1 server.
Get started free