tornado: multipart split() creates huge temp list before max_parts check -> memory amplification DoS (httputil.py:34)
Published 1 Sept 2026 · Updated 16 Sept 2026
Is your project on an affected tornado?
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.8
- Fixed in
- 6.5.8
pip install 'tornado>=6.5.8'Details
Description
Summary
parse_multipart_form_data (httputil.py:34) calls
data.split(b"--"+boundary+b"\r\n") before the max_parts check (:35).
A 600KB body with 100k parts creates a 100k-element transient list first,
then rejects transient memory amplification (each split element is a copy).
Pre-auth HTTP DoS.
Root cause
parts = data[:final_boundary_index].split(b"--" + boundary + b"\r\n") # :34 huge list first
if len(parts) > config.max_parts: # :35 check after
raise HTTPInputError("multipart/form-data has too many parts")PoC
gist: https://gist.github.com/afldl/649861f25d39b53b7edbe0298e171617
poc.py + output.txt (100k parts from 600KB transient list).
Fix
Count separators without materializing the list (e.g. data.count(b"--"+boundary) first).
Credit
Reported by afldl, 2026-07.
Is GHSA-8423-8fgw-73vq 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
References
- Linkgithub.com/tornadoweb/tornado/security/advisories/GHSA-8423-8fgw-73vq
- Linkgithub.com/tornadoweb/tornado/pull/3704
- Linkgithub.com/tornadoweb/tornado/commit/de85b3f87446e323e881bbaa3d5a74f4b76e5f05
- Linkgist.github.com/afldl/649861f25d39b53b7edbe0298e171617
- Packagegithub.com/tornadoweb/tornado
- Linkgithub.com/tornadoweb/tornado/releases/tag/v6.5.8
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.