GHSA-wwv5-g3v4-889x: Tornado: Incomplete fix for CVE-2026-35536: cookie attribute injection re-opened via the legacy case-insensitive `**kwargs` path in `set_cookie`
Summary The CVE-2026-35536 fix added a validation loop that rejects [\x00-\x20\x3b\x7f], but only for the hardcoded lowercase keys name/domain/path/samesite. The still-live deprecated kwargs path writes attacker-supplied attribute values straight into the Morsel with no validation, and because Morsel.setitem is case-insensitive, a capitalized kwarg (Domain=, Path=, SameSite=, Max-Age=) routes to the same reserved…
Published Sep 1, 2026
Affected packages
tornado
- Ecosystem
- PyPI
- Affected
- >= 6.5.5, < 6.5.8
- Fixed in
- 6.5.8
- Check
pip show tornado
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
The CVE-2026-35536 fix added a validation loop that rejects [\x00-\x20\x3b\x7f], but only for the hardcoded lowercase keys name/domain/path/samesite. The still-live deprecated **kwargs path writes attacker-supplied attribute values straight into the Morsel with no validation, and because Morsel.__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.
self.set_cookie("sid", "abc", Domain="evil.com; Secure; SameSite=None")
# -> Set-Cookie: sid=abc; Domain=evil.com; Secure; SameSite=None; Path=/
# Sanity (the canonical lowercase named arg IS blocked):
self.set_cookie("sid", "abc", domain="evil.com; Secure") # -> http.cookies.CookieErrorThe patch's regression test (SetCookieForbiddenCharHandler) only exercises the four named params, never the **kwargs path, 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 trailingif kwargs:loop doesmorsel[k] = vwith no character validation.
Steps to reproduce
GET /upper (uses Domain= kwarg) emits Set-Cookie: c_upper=v; Domain=evil.com; Secure; SameSite=None; Path=/; GET /lower (uses lowercase domain=) returns a CookieError.
Impact
Injection of independent cookie attributes (force/drop Secure/HttpOnly/SameSite, rebind Domain/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 **kwargs loop (after normalizing the key 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).
Credited to sec-reex, arpitjain099.
References
- https://github.com/tornadoweb/tornado/security/advisories/GHSA-wwv5-g3v4-889x
- https://github.com/tornadoweb/tornado/pull/3704
- https://github.com/tornadoweb/tornado/pull/3706
- https://github.com/tornadoweb/tornado/commit/6ef836e43e1278530041376adb32504daa977b91
- https://github.com/tornadoweb/tornado/commit/da284767eae8e1f0484f123b8c3225f6465b09c7
- https://github.com/tornadoweb/tornado/releases/tag/v6.5.8
- https://github.com/advisories/GHSA-wwv5-g3v4-889x
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More PyPI vulnerabilities
All PyPI entriesCVE-2026-126347
Tornado: Open redirect via triple-slash redirect paths
low3.1Nov 13, 2026CVE-2026-115927
Tornado: Event loop blocking and excess memory use from chunked bodies with many small chunks
medium5.3Oct 28, 2026CVE-2026-116577
Tornado: Quadratic CPU usage when parsing HTTP headers with line folding
medium5.3Oct 28, 2026CVE-2026-116578
Tornado: Open redirect in RedirectHandler via protocol-relative URLs
low2.1Oct 28, 2026GHSA-3hv7-mjh2-fv65
Tornado: Unbounded query-string argument count allows event-loop-stalling DoS
medium5.3Sep 30, 2026GHSA-c2m8-h5v5-343r
Tornado: StaticFileHandler follows symlinks outside static root (path traversal)
high8.2Sep 30, 2026
