CVE-2024-52804
High · 7.5Tornado has an HTTP cookie parsing DoS vulnerability
CVSS
7.5
EPSS
1.0%
Published
Nov 22, 2024
CISA due date
—
Cloudanix analysis
A flaw in the web framework can let someone slow down or disrupt affected services by sending specially crafted web requests.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Low
- Impact
- Denial Of Service
- Component
- Library
- Class
- Denial of service
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Tornado versions prior to 6.4.2 use an HTTP cookie parsing algorithm that can exhibit quadratic-time behavior when processing specially crafted Cookie headers. Because Tornado performs this parsing in the event loop thread, a single request with a pathological cookie header can consume excessive CPU and block the event loop, delaying or preventing the application from processing other requests. The flaw affects availability rather than confidentiality or integrity; it does not directly enable code execution, authentication bypass, or data theft.
Why it matters to the business
Publicly reachable services built on vulnerable Tornado versions may be slowed or made unavailable by low-cost HTTP requests, causing user-facing outages, API timeouts, failed transactions, degraded service-level objectives, and increased infrastructure load. The issue is not listed in CISA KEV and has low EPSS at the time of assessment, but the exploit concept is simple and targets availability, so internet-facing Tornado applications should still be prioritized for upgrade, especially where downtime has material operational or revenue impact.
How an attack unfolds
An attacker identifies an HTTP endpoint served by a vulnerable Tornado application and sends requests containing maliciously structured Cookie headers designed to trigger inefficient parsing behavior. Tornado attempts to parse the cookie string on the main event loop thread; as the header size or structure grows, parsing time can increase disproportionately. While the event loop is occupied parsing the crafted header, normal request handling is blocked or delayed. Repeating these requests, or sending them concurrently, can drive CPU utilization high and cause broad request latency, timeouts, health-check failures, or service unavailability. No authentication is typically required if the targeted endpoint accepts unauthenticated HTTP requests and reaches Tornado's request parsing path.
How to fix it
Upgrade Tornado to version 6.4.2 or later. For source-based deployments using the upstream Git repository, ensure the code includes commit a5ecfab15e52202a46d34638aad93cddca86d87b or a later commit containing the fix. Rebuild and redeploy all affected applications, containers, virtual environments, and packaged services that include Tornado. As compensating controls until upgrades are complete, enforce reasonable maximum request header sizes at reverse proxies and load balancers, limit Cookie header length, rate-limit repeated requests with oversized Cookie headers, and ensure edge infrastructure can reject abnormal headers before traffic reaches Tornado. These mitigations reduce exposure but should not be treated as a substitute for upgrading.
How to confirm the fix worked
Confirm dependency versions in all runtime artifacts, not only source repositories. Use package inventory, lockfiles, container image scans, SBOMs, and runtime checks such as `python -c "import tornado; print(tornado.version)"` to verify Tornado is 6.4.2 or later. For Git-based vendored deployments, verify that commit a5ecfab15e52202a46d34638aad93cddca86d87b or a later fixed revision is present. Validate edge controls by sending benign test requests with oversized Cookie headers in a controlled environment and confirming they are rejected or handled without event-loop stalls, CPU spikes, or broad request latency. After remediation, monitor CPU utilization, request latency, 4xx/5xx rates, and reverse-proxy header rejection logs to confirm the service remains stable under abnormal Cookie traffic.
Typical attack path
- Discover an application or API endpoint served by Tornado prior to version 6.4.2.
- Send HTTP requests with unusually large or malformed Cookie headers crafted to trigger worst-case parsing complexity.
- Cause Tornado's event loop thread to spend excessive CPU time parsing cookies.
- Repeat or parallelize requests to sustain CPU saturation and event-loop blocking.
- Induce user-visible latency, request timeouts, failed health checks, or denial of service.
How to detect it
Investigate whether the application experienced unexplained CPU saturation, event-loop lag, latency spikes, or availability incidents correlated with HTTP requests containing unusually large, repetitive, or malformed Cookie headers. Useful log sources include reverse-proxy access logs, WAF/API gateway logs, load balancer logs, application access logs, APM traces, host CPU metrics, container metrics, and error logs showing request timeouts or upstream failures. Search for requests with very large `Cookie:` header values, repeated cookie delimiters, unusually high cookie counts, long runs of semicolons or equals signs, and repeated requests from the same source IPs or autonomous systems immediately preceding service degradation. Because exploitation does not require a persistent payload, file artifact, or spawned process, detection is primarily behavioral: correlate abnormal Cookie headers with CPU spikes, event-loop blocking, increased response times, and elevated 5xx/timeout responses. If edge devices do not log request headers by default, review sampled request captures, WAF event details, APM request metadata, or packet captures where available.
- Cookie:
- ; ; ; ;
- Cookie header length
- request header too large
- large Cookie header
- oversized Cookie header
- upstream timed out
- upstream prematurely closed connection
- HTTP 502
- HTTP 503
- HTTP 504
- tornado.application
- tornado.access
- tornado.version < 6.4.2
- tornado==6.4.1
- tornado==6.4.0
- tornado==6.3.3
- tornado==6.3.2
- tornado==6.3.1
- tornado==6.3
- tornado==6.2
- tornado==6.1
- tornado==6.0
What your security team should do
- Inventory all applications, containers, serverless packages, and Python environments that include Tornado and identify versions prior to 6.4.2.
- Prioritize remediation for internet-facing Tornado services, authentication entry points, APIs, and services with strict availability requirements.
- Upgrade Tornado to 6.4.2 or later, or ensure Git-based deployments include commit a5ecfab15e52202a46d34638aad93cddca86d87b or later.
- Deploy temporary controls at reverse proxies, WAFs, API gateways, and load balancers to cap Cookie header size and reject abnormal request headers before they reach Tornado.
- Add monitoring and alerting for spikes in Cookie header length, repeated requests with oversized Cookie headers, elevated CPU, event-loop latency, request timeouts, and sudden increases in 499/500/502/503/504 responses.
- Review access logs and performance telemetry for historical signs of attempted denial-of-service activity using oversized or unusual Cookie headers.
- Include this vulnerability in dependency governance so builds fail or alert when Tornado versions older than 6.4.2 are introduced.
The record
The algorithm used for parsing HTTP cookies in Tornado versions prior to 6.4.2 sometimes has quadratic complexity, leading to excessive CPU consumption when parsing maliciously-crafted cookie headers. This parsing occurs in the event loop thread and may block the processing of other requests. See also CVE-2024-7592 for a similar vulnerability in cpython.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| PyPI | tornado | 0 | 6.4.2 |
| AlmaLinux:9 | python3-tornado | 0 | 6.4.2-1.el9_5 |
| Chainguard | airflow | 0 | 2.10.3-r2 |
| Chainguard | airflow-bitnami-compat | 0 | 2.10.3-r2 |
| Chainguard | airflow-compat | 0 | 2.10.3-r2 |
| Chainguard | dask-gateway | 0 | 2024.1.0-r12 |
| Chainguard | dask-gateway-server | 0 | 2024.1.0-r12 |
| Chainguard | kubeflow-pipelines-visualization-server | 0 | 2.3.0-r4 |
| Chainguard | py3-supported-tornado | 0 | 6.4.2-r0 |
| Chainguard | py3-tornado | 0 | 6.4.2-r0 |
| Chainguard | py3.10-tornado | 0 | 6.4.2-r0 |
| Chainguard | py3.11-tornado | 0 | 6.4.2-r0 |
| Chainguard | py3.12-tornado | 0 | 6.4.2-r0 |
| Chainguard | py3.13-tornado | 0 | 6.4.2-r0 |
| Debian:11 | python-tornado | 0 | 6.1.0-1+deb11u1 |
| Debian:12 | python-tornado | 0 | 6.2.0-3+deb12u1 |
| Debian:13 | python-tornado | 0 | 6.4.2-1 |
| Debian:14 | python-tornado | 0 | 6.4.2-1 |
| Mageia:9 | python-tornado | 0 | 6.3.2-1.1.mga9 |
| Red Hat:enterprise_linux:9::appstream | python-tornado | 0 | 0:6.4.2-1.el9_5 |
| Red Hat:enterprise_linux:9::appstream | python-tornado-debugsource | 0 | 0:6.4.2-1.el9_5 |
| Red Hat:enterprise_linux:9::appstream | python3-tornado | 0 | 0:6.4.2-1.el9_5 |
| Red Hat:enterprise_linux:9::appstream | python3-tornado-debuginfo | 0 | 0:6.4.2-1.el9_5 |
| Red Hat:rhel_eus:9.2::appstream | python-tornado | 0 | 0:6.4.2-1.el9_2 |
| Red Hat:rhel_eus:9.2::appstream | python-tornado-debugsource | 0 | 0:6.4.2-1.el9_2 |
| Red Hat:rhel_eus:9.2::appstream | python3-tornado | 0 | 0:6.4.2-1.el9_2 |
| Red Hat:rhel_eus:9.2::appstream | python3-tornado-debuginfo | 0 | 0:6.4.2-1.el9_2 |
| Red Hat:rhel_eus:9.4::appstream | python-tornado | 0 | 0:6.4.2-1.el9_4 |
| Red Hat:rhel_eus:9.4::appstream | python-tornado-debugsource | 0 | 0:6.4.2-1.el9_4 |
| Red Hat:rhel_eus:9.4::appstream | python3-tornado | 0 | 0:6.4.2-1.el9_4 |
| Red Hat:rhel_eus:9.4::appstream | python3-tornado-debuginfo | 0 | 0:6.4.2-1.el9_4 |
| Rocky Linux:9 | python-tornado | 0 | 0:6.4.2-1.el9_5 |
| SUSE:Linux Enterprise Module for Python 3 15 SP5 | python-tornado6 | 0 | 6.3.2-150400.9.6.1 |
| SUSE:Linux Enterprise Module for Python 3 15 SP6 | python-tornado6 | 0 | 6.3.2-150400.9.6.1 |
| Ubuntu:20.04:LTS | python-tornado | 0 | No fix |
| Ubuntu:22.04:LTS | python-tornado | 0 | No fix |
| Ubuntu:24.04:LTS | python-tornado | 0 | 6.4.0-1ubuntu0.1 |
| Ubuntu:24.10 | python-tornado | 0 | 6.4.1-2ubuntu0.1 |
| Ubuntu:25.04 | python-tornado | 0 | 6.4.2-1 |
| Ubuntu:25.10 | python-tornado | 0 | 6.4.2-1 |
| Ubuntu:Pro:18.04:LTS | python-tornado | 0 | 4.5.3-1ubuntu0.2+esm1 |
| Ubuntu:Pro:20.04:LTS | python-tornado | 0 | 6.0.3+really5.1.1-3ubuntu0.1~esm1 |
| Ubuntu:Pro:22.04:LTS | python-tornado | 0 | 6.1.0-3ubuntu0.1~esm1 |
| Wolfi | airflow | 0 | 2.10.3-r2 |
| Wolfi | airflow-bitnami-compat | 0 | 2.10.3-r2 |
| Wolfi | airflow-compat | 0 | 2.10.3-r2 |
| Wolfi | dask-gateway | 0 | 2024.1.0-r12 |
| Wolfi | dask-gateway-server | 0 | 2024.1.0-r12 |
| Wolfi | kubeflow-pipelines-visualization-server | 0 | 2.3.0-r4 |
| Wolfi | py3-supported-tornado | 0 | 6.4.2-r0 |
| Wolfi | py3-tornado | 0 | 6.4.2-r0 |
| Wolfi | py3.10-tornado | 0 | 6.4.2-r0 |
| Wolfi | py3.11-tornado | 0 | 6.4.2-r0 |
| Wolfi | py3.12-tornado | 0 | 6.4.2-r0 |
| Wolfi | py3.13-tornado | 0 | 6.4.2-r0 |
| openSUSE:Leap 15.5 | python-tornado6 | 0 | 6.3.2-150400.9.6.1 |
| openSUSE:Leap 15.6 | python-tornado6 | 0 | 6.3.2-150400.9.6.1 |
| openSUSE:Tumbleweed | python-tornado6 | 0 | 6.4.2-1.1 |
Related vulnerabilities
- CVE-2025-47287 Tornado vulnerable to excessive logging caused by malformed multipart form data Also affects tornado
- GHSA-qppv-j76h-2rpx Tornado vulnerable to HTTP request smuggling via improper parsing of `Content-Length`… Also affects tornado
- CVE-2024-12797 Issue summary: Clients using RFC7250 Raw Public Keys (RPKs) to authenticate a server may… Also affects airflow
- CVE-2024-56201 Jinja has a sandbox breakout through malicious filenames Also affects airflow
- CVE-2024-56326 Jinja has a sandbox breakout through indirect reference to format method Also affects airflow
- CVE-2024-52304 aiohttp is an asynchronous HTTP client/server framework for asyncio and Python. Also affects airflow
- CVE-2024-52303 aiohttp is an asynchronous HTTP client/server framework for asyncio and Python. Also affects airflow
- CVE-2024-21272 Vulnerability in the MySQL Connectors product of Oracle MySQL (component… Also affects airflow