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

CVE-2026-115927: Tornado: Event loop blocking and excess memory use from chunked bodies with many small chunks

mediumCVSS 3.1 5.3GHSA-r4j5-9xpp-3985

Tornado before 6.6 parses chunked HTTP/1.1 request bodies without yielding to the event loop, so one request made of millions of 1-byte chunks freezes the whole server process. It also uses about 20 times more memory than the bytes received. No login is needed. Upgrade to Tornado 6.6.

Published Oct 28, 2026 · Analysis Nov 1, 2026

What an attacker can do

When a body arrives with chunked transfer encoding, Tornado processes every chunk that has already arrived in one go. A client that sends millions of 1-byte chunks keeps the event loop busy for the whole parse, so every other connection on that process stalls. A body near the default max_body_size of 100 MB can block for close to a minute, and the attacker can repeat or parallelize requests.

A handler that does not use @stream_request_body also stores each chunk as a separate object, which takes roughly 20 times the memory of the data. Any Tornado server that reads a request body is affected, including handlers that do not reject the request before the body is read. SimpleAsyncHTTPClient has the same problem when it reads a response from a malicious server. Lowering max_body_size limits each request's cost but does not remove the flaw. The score is 5.3 with low availability impact, but it is cheap to repeat.

Who is affected

The tornado pip package below 6.6. All Tornado HTTP servers are affected when a request body is read, and so is SimpleAsyncHTTPClient talking to untrusted servers. Many projects pull in Tornado indirectly, for example Jupyter. Check the 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:

pip install --upgrade "tornado>=6.6"

Tornado 6.6 yields to the event loop periodically while reading any body, combines small chunks before calling data_received, and stores non-streaming bodies more compactly. If you use @stream_request_body, note that the pieces passed to data_received no longer match HTTP chunk boundaries. Workarounds: run Tornado behind a reverse proxy that buffers request bodies and forwards them with Content-Length, and lower max_body_size for the server or for individual handlers.

How to tell if you were hit

Look for periods when a Tornado process stops answering every request for seconds to a minute, with a single large request in progress. Check proxy or access logs for Transfer-Encoding: chunked requests with large bodies from one client, and for memory spikes far beyond the body sizes involved. Slow-request or latency alerts across all routes at once are the usual sign.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Summary

When Tornado reads an HTTP/1.1 body that uses chunked transfer encoding, it processes all chunks that have already arrived without yielding to the event loop. A client can send a body made of millions of 1-byte chunks, which blocks the event loop (and therefore every other connection served by that process) for the entire time it takes to parse the body. A body near the default max_body_size of 100 MB can block the process for close to a minute, and the attacker can repeat or parallelize these requests.

Bodies made of tiny chunks also consumed far more memory than their size: a handler that does not use @stream_request_body stored each chunk as a separate object, using roughly 20 times as much memory as the bytes received.

Impact

All Tornado HTTP servers are affected when they receive a request body for a handler that reads it, which includes any handler that does not reject the request before the body is read. No authentication is required. Lowering max_body_size reduces the maximum blocking time and memory use for each request but does not remove the issue.

SimpleAsyncHTTPClient is affected in the same way when it reads a response from a malicious server.

Patches

Fixed in Tornado 6.6. Tornado now yields to the event loop periodically while reading any body, combines small chunks before passing them to data_received, and stores non-streaming bodies more compactly.

Applications using @stream_request_body should note that the pieces passed to data_received no longer correspond to HTTP chunk boundaries.

Workarounds

  • Run Tornado behind a reverse proxy that buffers request bodies and forwards them with a Content-Length header instead of chunked encoding.
  • Lower max_body_size (for the whole server or for individual handlers) to limit the impact of each request.

Credit

Reported by uttej-badwane.

Credited to uttej-badwane.

Questions

Does the attacker need to authenticate?

No. The advisory says no authentication is required, as long as the server reads the request body.

Does lowering max_body_size fix it?

No. It reduces the blocking time and memory use of each request but does not remove the issue.

Does a reverse proxy help?

Yes, if it buffers request bodies and forwards them with a Content-Length header instead of chunked encoding, as the advisory suggests.

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