NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · PyPI

CVE-2026-116577: Tornado: Quadratic CPU usage when parsing HTTP headers with line folding

mediumCVSS 3.1 5.3GHSA-pcg2-g6cj-q92c

Tornado before 6.6 parses HTTP headers in quadratic time when a header value is spread across many obsolete line-folding (obs-fold) lines. An unauthenticated client can block the IOLoop thread and stall every connection that process serves. Upgrade to Tornado 6.6.0. Only availability is affected.

Published Oct 28, 2026 · Analysis Nov 1, 2026

What an attacker can do

Tornado's header parser handles a folded header, where continuation lines start with whitespace, with work that grows with the square of the header size. The parsing runs before any application code, so the attacker needs no login and no particular handler.

Because Tornado serves requests on a single IOLoop thread per process, one slow parse blocks all other connections on that process. The damage depends on max_header_size:

  • At the default 64 KB, each malicious request blocks the loop for tens of milliseconds. Repeated requests can degrade service.
  • With a raised limit, cost climbs with the square of the size. The advisory says a single 1 MB request can block a process for several seconds.

The advisory ties this to CVE-2025-67725, whose fix covered repeated headers but not line-folded continuations. Confidentiality and integrity are not affected. Any Tornado HTTP server reachable by an attacker is exposed, including services that sit behind a proxy that passes folded headers through.

Who is affected

All Tornado HTTP servers on versions below 6.6 are affected. Servers with a raised max_header_size are hit hardest.

Check the installed version:

pip show tornado

tornado

Ecosystem
PyPI
Affected
< 6.6
Fixed in
6.6
Check
pip show tornado

How to fix it

Upgrade to Tornado 6.6.0:

pip install --upgrade "tornado>=6.6"

The fix removes obs-fold support completely. Header lines that begin with whitespace are now rejected, so a client or upstream that sends folded headers will get errors. Test before you roll out if you depend on them.

Workarounds from the advisory: keep max_header_size at its default or lower it, which limits the impact without removing it. Or put a reverse proxy in front that rejects or normalizes obs-fold before forwarding.

How to tell if you were hit

No exploit traces are documented. Look for requests whose header block holds many short lines starting with a space or tab. Also look for sudden event-loop stalls: slow responses across unrelated endpoints, high CPU in a single Tornado worker process, and callback-lag warnings from asyncio debug mode. Proxy logs showing unusually large request header sizes from one client are another sign.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

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 max_header_size:

  • Default (64 KB): each malicious request blocks the event loop for tens of milliseconds. Repeated requests can degrade service.
  • Raised `max_header_size`: 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 max_header_size 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.

Credited to manus-pi, manus-use.

Questions

Does this need authentication?

No. Header parsing runs before any handler or application code, so an unauthenticated client can trigger it.

How is this different from CVE-2025-67725?

That fix covered repeated headers. This one covers header values continued across many obs-fold lines, which the earlier fix missed.

Can I just lower max_header_size?

It limits the impact because cost grows with the square of header size, but it does not remove the flaw. Upgrade to 6.6.0.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More PyPI vulnerabilities

All PyPI entries