CVE-2024-7592·Python vulnerability
There is a LOW severity vulnerability affecting CPython, specifically the 'http.cookies' standard library module. When parsing cookies that contained backslashes for quoted characters in the cookie value, the parser would use an algorithm with quadratic complexity, resulting in excess CPU resources being used while parsing the value.
- Severity
- high
- Software
- Python
- Fixed in
- 3.12.6
- Published
How likely is exploitation
FIRST's Exploit Prediction Scoring System puts the probability of this CVE being exploited in the next 30 days at 0.80% — higher than 74% of all published CVEs. EPSS is an independent forecast of exploitation, not a severity rating: it says nothing about how much damage a successful attack does, which is what a CVSS score measures.
Read the two together. CVE-2024-7592 scores 7.5 on CVSS, so a successful attack would be serious — but at 0.80%, almost nobody is currently attempting it. That is a different situation from a flaw under mass exploitation, and it is usually the difference between patching on your next maintenance window and patching tonight.
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 remediate this denial-of-service vulnerability in the http.cookies module. The vulnerability stems from inefficient cookie parsing when backslashes are present in quoted cookie values, causing excessive CPU consumption. Organizations running Python 3.12.0 through 3.12.5 should prioritize this update to prevent resource exhaustion attacks targeting cookie-processing endpoints.
sudo dnf update python3Defensia detects this vulnerability
How to check if you are affected
- Check installed Python version: python3 --version
- Verify if http.cookies is in use: grep -r 'http.cookies\|SimpleCookie\|BaseCookie' /var/www /opt /home --include='*.py' 2>/dev/null
- Review web server access logs for requests with unusual Cookie headers containing multiple backslashes: grep -E 'Cookie:.*\\.*\\' /var/log/apache2/access.log /var/log/nginx/access.log
- After patching, confirm the fix: python3 --version and verify output shows 3.12.6 or higher
FAQ
What is CVE-2024-7592?
CVE-2024-7592 is a denial-of-service vulnerability in Python's http.cookies module that triggers quadratic-time complexity parsing when processing cookies containing backslash-escaped characters. This flaw allows attackers to exhaust server CPU resources by sending maliciously crafted cookie headers.
Is CVE-2024-7592 being actively exploited?
No, CVE-2024-7592 is not listed on the CISA Known Exploited Vulnerabilities (KEV) catalog and no public exploit code is available at this time.
What versions of Python are affected by CVE-2024-7592?
Python 3.12.0 through 3.12.5 are affected. Python 3.12.6 and later versions contain the fix.
How do I check if my server is vulnerable to CVE-2024-7592?
Run 'python3 --version' and check if the output shows a version between 3.12.0 and 3.12.5 inclusive. Additionally, verify that http.cookies functionality is exposed in your web applications by searching source code for imports of that module.
Does Defensia detect CVE-2024-7592?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If Python is installed on a monitored server, CVE-2024-7592 will appear in your dashboard with remediation steps.
Related Python CVEs
References
- https://github.com/python/cpython/commit/391e5626e3ee5af267b97e37abc7475732e67621
- https://github.com/python/cpython/commit/44e458357fca05ca0ae2658d62c8c595b048b5ef
- https://github.com/python/cpython/commit/a77ab24427a18bff817025adb03ca920dc3f1a06
- https://github.com/python/cpython/commit/b2f11ca7667e4d57c71c1c88b255115f16042d9a
- https://github.com/python/cpython/commit/d4ac921a4b081f7f996a5d2b101684b67ba0ed7f
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2024-7592. Free for 1 server.
Get started free