MediumGHSA-r4j5-9xpp-3985CVE-2026-115927

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

Published 28 Oct 2026 · Updated 28 Oct 2026

Is your project on an affected tornado?

Private repo? Upload its lockfile instead, or connect GitHub to check every repo.

Look after several Python apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie

Affected package

Affected
<6.6
Fixed in
6.6
Update to the fixed version for your release line, for example:pip install 'tornado>=6.6'

Details

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.

Is GHSA-r4j5-9xpp-3985 in any of your client repos?

Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected tornado, and gives you the command that fixes it.

More advisories for tornado

  • LowCVE-2026-126347Tornado: Open redirect via triple-slash redirect paths · 13 Nov 2026
  • LowCVE-2026-116578Tornado: Open redirect in RedirectHandler via protocol-relative URLs · 28 Oct 2026
  • MediumCVE-2026-116577Tornado: Quadratic CPU usage when parsing HTTP headers with line folding · 28 Oct 2026
  • MediumCVE-2026-103261Tornado: Unbounded query-string argument count allows event-loop-stalling DoS · 30 Sept 2026
  • HighCVE-2026-103262tornado: CurlAsyncHTTPClient enforces no response-size limit — decompression bomb drives unbounded memory accumulation to OOM · 30 Sept 2026
  • HighCVE-2026-103263Tornado: StaticFileHandler follows symlinks outside static root (path traversal) · 30 Sept 2026
All 28 advisories for tornado

References

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.