CVE-2026-116577: Tornado: Quadratic CPU usage when parsing HTTP headers with line folding
Summary
Tornado's HTTP header parser takes quadratic time (O(n²)) when a header value is continued across many "obsolete line folding" (obs-fold) lines. An unauthenticated attacker can send a request whose header block is mostly short continuation lines. Parsing it uses a large amount of CPU on the IOLoop thread and blocks every other connection that process is serving.
This issue is closely related to CVE-2025-67725 (GHSA-c98p-7wgm-6p64). The fix for that advisory covered repeated headers but not line-folded continuations.
Impact
All Tornado HTTP servers are affected. Header parsing runs before any application code, so no authentication or particular handler is required.
How bad it gets depends on maxheadersize:
- Default (64 KB): each malicious request blocks the event loop for tens of milliseconds. Repeated requests can degrade service. - Raised maxheadersize: the cost grows with the square of the header size. A single 1 MB request can block the process for several seconds.
Only availability is affected. Confidentiality and integrity are not.
Patches
Fixed in Tornado 6.6 by removing support for obsolete line folding completely; header lines that begin with whitespace are now rejected.
Workarounds
- Keep maxheadersize at its default value or lower it. This limits the impact but doesn't remove it. - Run Tornado behind a reverse proxy that rejects or normalizes obsolete line folding before forwarding requests.
Credit
Reported by @manus-pi.
Other sources
Tornado is a Python web framework and asynchronous networking library. Prior to 6.6, Tornado's HTTP header parser accepts obsolete line folding and repeatedly concatenates short continuation lines, causing quadratic CPU consumption on the IOLoop thread. An unauthenticated client can submit a header block containing many obsolete line-folding continuations before application code runs, blocking other connections served by the process. The cost grows with maxheadersize, and only availability is affected. This issue is fixed in version 6.6.
— Ubuntu
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
pip/tornadoto a version that resolves this vulnerability.Fixed in 6.6 - Upgrade
Upgrade
debian/python-tornadoto a version that resolves this vulnerability.Fixed in 6.6.0-1 - Upgrade
Upgrade
Tornadoto a version that resolves this vulnerability.Fixed in 6.6 - Configuration
Keep max_header_size at its default value or lower it.
Tornado HTTP server max_header_size = default value or lower - Compensating control
Run Tornado behind a reverse proxy that rejects or normalizes obsolete line folding before forwarding requests.
Event History
Frequently Asked Questions
Which deployments are exposed to this issue?
Deployments using Tornado versions earlier than 6.6 are exposed when they accept HTTP requests. The vulnerable parsing occurs before application code runs, so application-level authentication or request handling does not prevent the attack.
What does an attacker need to exploit it?
An unauthenticated remote client only needs to send an HTTP header block with many obsolete line-folding continuation lines. No user interaction or prior privileges are required.
What is the practical impact on a Tornado process?
Processing the crafted headers can consume quadratic CPU time on the IOLoop thread, blocking other connections served by that process. The issue affects availability only; the provided data does not indicate confidentiality or integrity impact.
What should be done if upgrading cannot happen immediately?
The provided data identifies version 6.6 as the fix. It also states that the processing cost grows with max_header_size, so limiting that setting can reduce exposure while an upgrade is pending.