LowGHSA-cx3h-4qpv-8hc9CVE-2026-49854PYSEC-2026-3388

Tornado has out-of-bounds memory access via C extension

Published 12 Jun 2026 · Updated 10 Sept 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.5.6
Fixed in
6.5.6
Update to the fixed version for your release line, for example:pip install 'tornado>=6.5.6'

Details

Summary

Tornado's optional native extension tornado.speedups implements websocket_mask without validating that the mask argument is exactly four bytes long. The C function reads four bytes from mask unconditionally, even when Python passes a shorter byte string. This can read beyond the provided buffer, exposing up to 3 bytes of uninitialized memory.

The behavior is reachable from Tornado's XSRF token decoder when xsrf_cookies=True and the native extension is active.

Mitigations

This bug is fixed in Tornado 6.5.6. Prior to upgrading to this version, setting the environment variable TORNADO_EXTENSION=0 will disable the vulnerable code (at the expense of reducing websocket performance).

Is GHSA-cx3h-4qpv-8hc9 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
  • MediumCVE-2026-115927Tornado: Event loop blocking and excess memory use from chunked bodies with many small chunks · 28 Oct 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
All 28 advisories for tornado

References

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