Update dependency tornado to v6.5.8 [SECURITY] - #1004
renovate[bot] wants to merge 1 commit into
Conversation
5508dc3 to
412903f
Compare
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: Organization UI Review profile: QUIET Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
412903f to
32c7558
Compare
|
Superseded by #1042, which bundles this tornado security update with all remaining documentation dependency alerts. |
Renovate Ignore NotificationBecause you closed this PR without merging, Renovate will ignore this update ( If you accidentally closed this PR, or if you changed your mind: rename this PR to get a fresh replacement PR. |
This PR contains the following updates:
6.5.7→6.5.8Tornado: Incomplete fix for CVE-2026-35536: cookie attribute injection re-opened via the legacy case-insensitive
**kwargspath inset_cookieGHSA-wwv5-g3v4-889x
More information
Details
Summary
The CVE-2026-35536 fix added a validation loop that rejects
[\x00-\x20\x3b\x7f], but only for thehardcoded lowercase keys
name/domain/path/samesite. The still-live deprecated**kwargspathwrites attacker-supplied attribute values straight into the
Morselwith no validation, and becauseMorsel.__setitem__is case-insensitive, a capitalized kwarg (Domain=,Path=,SameSite=,Max-Age=)routes to the same reserved attribute while bypassing the loop — re-opening
;-delimited attribute injection.The patch's regression test (
SetCookieForbiddenCharHandler) only exercises the four named params, never the**kwargspath, so the gap is not regression-covered.Affected code
tornado/web.py→RequestHandler.set_cookie: the validation loop covers only the lowercase named args;the trailing
if kwargs:loop doesmorsel[k] = vwith no character validation.Steps to reproduce
GET /upper(usesDomain=kwarg) emitsSet-Cookie: c_upper=v; Domain=evil.com; Secure; SameSite=None; Path=/;GET /lower(uses lowercasedomain=) returns aCookieError.Impact
Injection of independent cookie attributes (force/drop
Secure/HttpOnly/SameSite, rebindDomain/Path)— the same impact CVE-2026-35536 closed, via the sibling path the patch missed. Conditional on the app using
a capitalized/legacy keyword.
Suggested remediation
Apply the same
[\x00-\x20\x3b\x7f]validation to every entry in the**kwargsloop (after normalizing thekey case), or remove the deprecated kwargs path; add a regression test for capitalized kwargs.
Credit
Reported as part of an incomplete-patch measurement study (responsible disclosure).
Severity
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:L/VI:L/VA:N/SC:N/SI:N/SA:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
tornado: multipart split() creates huge temp list before max_parts check -> memory amplification DoS (httputil.py:34)
GHSA-8423-8fgw-73vq
More information
Details
Description
Summary
parse_multipart_form_data(httputil.py:34) callsdata.split(b"--"+boundary+b"\r\n")before themax_partscheck (: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
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.
Severity
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Tornado: Urlencoded body parsing omits max_num_fields, so one request can stall the event loop
CVE-2026-82397 / GHSA-mpf4-983q-p7j4
More information
Details
Summary
Tornado parses
application/x-www-form-urlencodedbodies withurllib.parse.parse_qsand does not passmax_num_fields. A body made almost entirely of separators produces tens of millions of fields, and the parse happens on the event loop before the handler runs, so a single request stalls the whole server.Where it is
tornado/escape.py, at HEADe530031405e2154654dedc4c84d5656b557ea310:max_num_fieldsis the parameter CPython added for exactly this, and it is absent.The path to it is entirely server-side and pre-dispatch.
RequestHandler._executeparses the body attornado/web.py:1821, which reachesHTTPServerRequest._parse_bodyattornado/httputil.py:636, and the urlencoded branch ofparse_body_argumentscallsparse_qs_bytesattornado/httputil.py:1030.The size that reaches it is bounded only by the body cap, which defaults to the stream's
max_buffer_sizeof 104857600 attornado/iostream.py:239, applied as the request body default attornado/http1connection.py:136-140. A 100 MB body of separators is around fifty million fields.Impact
Denial of service against the whole process, not one request. Tornado is single-threaded and the parse is synchronous on the event loop, so every other connection waits. No authentication is needed if any route accepts a form post, which is the normal case.
Suggested fix
Pass a bound:
with a conservative default and a way for applications to raise it. CPython raises
ValueErrorwhen the limit is exceeded, which maps cleanly onto a 400.Lowering the default body cap for urlencoded specifically would help too, since 100 MB of form fields is not a shape any real client sends.
Why I do not think this is a duplicate
The published tornado advisories cover out-of-bounds access in the C extension, unbounded accumulation of decompressed chunks in
AsyncHTTPClient, the Authorization header surviving cross-origin redirects, credential leakage on curl handle reuse, and cookie attribute validation. The decompression one is the nearest in spirit and is on the client side; this is the server parsing a request body. The call is unchanged at HEAD.Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:HReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
tornadoweb/tornado (tornado)
v6.5.8Compare Source
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.