chore(deps): update dependency tornado to v6.5.8 [security] - #272
Open
renovate[bot] wants to merge 1 commit into
Open
chore(deps): update dependency tornado to v6.5.8 [security]#272renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.