CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



GHSA-WWV5-G3V4-889X

GHSA-wwv5-g3v4-889x: Cookie Attribute Injection in Tornado via Legacy Case-Insensitive kwargs

Amit Schendel
Amit Schendel
Senior Security Researcher

Sep 2, 2026·6 min read·20 visits

Executive Summary (TL;DR)

Tornado's cookie validation bypassed legacy case-insensitive kwargs, allowing arbitrary attribute injection.

An incomplete sanitization fix for CVE-2026-35536 in Tornado allowed cookie attribute injection. The framework's validation loop checked lowercase keyword arguments but neglected legacy case-insensitive parameters passed through arbitrary keyword arguments, which Python's underlying library parses case-insensitively.

Vulnerability Overview

The Tornado web framework utilizes a standard request-handling pipeline that provides cookie-setting utilities to web developers via the RequestHandler.set_cookie API. Historically, this method accepted both explicit lowercase parameter definitions and an arbitrary dictionary of keyword arguments passed through Python's variable argument unpacking mechanism. This dual-path architectural design was intended to maintain compatibility with legacy versions of Tornado and Python's native standard library cookie modules.

Under CVE-2026-35536, a security vulnerability was identified where malicious characters injected into standard cookie parameters could manipulate the structure of the resulting HTTP Set-Cookie response header. While the maintainers implemented a filtering mechanism to restrict dangerous characters within explicitly defined lowercase attributes, they omitted identical validation on legacy keyword parameters. This oversight created an alternative, unvalidated code path that leads to cookie attribute injection under specific application configurations.

The primary security risk of this design omission lies in the mismatch between Tornado's validation logic and the underlying parsing behavior of Python's standard library. Specifically, Python's http.cookies.Morsel class treats cookie option dictionary keys in a case-insensitive manner. By utilizing mixed-case or capitalized keyword arguments, an application inadvertently routes raw, unvalidated input to the exact same sensitive cookie fields that the original sanitization patch intended to protect.

Root Cause Analysis

To understand the root cause of GHSA-wwv5-g3v4-889x, it is necessary to examine how the Python standard library represents individual cookie elements. The http.cookies.Morsel class acts as a specialized dictionary containing key-value pairs representing standard cookie directives like domain, path, samesite, and secure. Internally, this class overrides the dictionary __setitem__ method to map keys in a case-insensitive fashion. Consequently, assigning a value to morsel["Domain"] has the exact same structural outcome as assigning a value to morsel["domain"].

Tornado's patch for CVE-2026-35536 established a validation loop that inspected a static list of explicit, lowercase parameter names. Specifically, the method evaluated the variables domain, path, and samesite against a regular expression designed to match forbidden characters, including carriage returns, line feeds, spaces, and semicolons. However, the subsequent step in the execution path processed any remaining entries inside the dynamic **kwargs dictionary without running them through this regular expression filter.

Because of this architectural structure, when a developer passes a capitalized keyword parameter such as Domain="example.com", the argument is captured by the variable keyword parameters dictionary instead of the explicit lowercase domain parameter. The validation routine is completely bypassed because the key Domain is not present in Tornado's static lowercase validation list. When Tornado later transfers the elements of kwargs to the Morsel object, Python's internal logic processes the assignment case-insensitively, applying the unvalidated, attacker-controlled payload directly to the cookie's domain attribute.

Code Flow and Diagram Analysis

The following architectural diagram illustrates the structural divergence between the validated lowercase path and the unvalidated legacy capitalized path inside the vulnerable framework version:

The core code flaw is located inside tornado/web.py within the RequestHandler.set_cookie method definition. The vulnerable implementation sequentially evaluates explicit parameter variables and then immediately assigns key-value pairs from kwargs directly to the Morsel instance. Below is an annotated representation of the vulnerable code section illustrating the exact bypass point:

# Vulnerable code structure in Tornado <= 6.5.7
 
# 1. Validation loop targets only explicit lowercase parameters
for attr_name, attr_value in [
    ("domain", domain),
    ("path", path),
    ("samesite", samesite),
]:
    if attr_value is not None and re.search(r"[\x00-\x20\x3b\x7f]", str(attr_value)):
        raise http.cookies.CookieError(
            f"Invalid cookie attribute {attr_name}={attr_value!r}"
        )
 
# 2. Bypassed kwargs assignment to the Morsel object
for k, v in kwargs.items():
    # If k is "Domain", it bypasses the validation loop above
    # but still modifies the "domain" attribute within http.cookies.Morsel
    morsel[k] = v

Exploitation Methodology

Exploiting this vulnerability requires that a Tornado-based web application passes untrusted user input into a legacy, capitalized keyword argument inside a set_cookie call. A common scenario involves applications where legacy routing configurations, helper functions, or wrappers handle cookie generation dynamically using keyword unpacking. When an attacker is able to supply raw string inputs to these parameters, they can structure payloads that contain control characters.

An attacker crafts a malicious request targeting the input parameter mapped to the capitalized cookie keyword. By introducing a semicolon followed by a new attribute definition (e.g., ; Secure or ; SameSite=None), the attacker forces the underlying standard library serialization process to treat the injected string as additional, distinct cookie attributes. Because the semicolon is not stripped or escaped, it acts as a delimiter within the raw outbound HTTP header.

Upon receiving the response, the victim's web browser parses the raw Set-Cookie HTTP header sequentially. The injection allows the attacker to override existing flags, scope the cookie to wider domains, or drop security attributes such as HttpOnly and Secure. This enables subsequent administrative actions, session hijacking attempts, or cross-site request forgery attacks depending on the precise nature of the modified cookie attributes.

Remediation and Fix Assessment

To completely remediate this vulnerability, the Tornado development team introduced a secondary validation phase that systematically scans the elements of the kwargs collection. The official security advisory addresses this issue in version 6.5.8. Below is the annotated patch implementation showing how validation is now extended to all dynamic keyword arguments:

# Patched structure in tornado/web.py (6.5.8)
for k, v in kwargs.items():
    # Extended sanitization loop for deprecated legacy attributes
    if re.search(r"[\x00-\x20\x3b\x7f]", str(v)):
        raise http.cookies.CookieError(
            f"Invalid cookie attribute {k}={v!r} for cookie {name!r}"
        )

The primary mitigation strategy is a direct upgrade of the Python environment to ensure Tornado is running at version 6.5.8 or later. If immediate upgrades are blocked due to environment freeze policies, developers must rewrite existing set_cookie calls to eliminate capitalized or mixed-case parameter names. All calls should use standard lowercase attributes to ensure the inputs are routed through the validated explicit code path.

Additionally, organizations should run automated static analysis tools to audit codebase directories for improper usages of the set_cookie API. Applying strict regular expression validation to any application-level wrappers that interact with raw HTTP cookies provides a robust defense-in-depth layer. Security teams should ensure that downstream reverse proxies or Web Application Firewalls (WAFs) reject response headers containing anomalous or duplicated cookie parameters.

Official Patches

tornadowebOfficial Tornado Security Advisory

Fix Analysis (2)

Technical Appendix

CVSS Score
2.3/ 10
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N

Affected Systems

Tornado web server applications using mixed-case cookie parameters (versions >= 6.5.5, < 6.5.8)

Affected Versions Detail

Product
Affected Versions
Fixed Version
tornado
tornadoweb
>= 6.5.5, < 6.5.86.5.8
AttributeDetail
CWE IDCWE-74
Attack VectorNetwork (AV:N)
CVSS Score2.3 (Low)
Exploit StatusProof-of-Concept (PoC)
KEV StatusNot Listed
ImpactCookie Attribute Injection / Security Policy Bypass

MITRE ATT&CK Mapping

T1539Steal Web Session Cookie
Credential Access
T1565Data Manipulation
Impair Defenses
CWE-74
Improper Neutralization of Special Elements in Output Used by a Downstream Component

The product constructs an output that is used by a downstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the downstream component.

Vulnerability Timeline

Vulnerability resolved in fix commits by Tornado maintainers
2026-08-06
Public advisory disclosure and GHSA publication
2026-09-01

References & Sources

  • [1]GitHub Security Advisory GHSA-wwv5-g3v4-889x
  • [2]Tornado Security Advisory
  • [3]Tornado Pull Request 3704
  • [4]Tornado Pull Request 3706

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•1 day ago•CVE-2026-11748
6.9

CVE-2026-11748: Unauthenticated LDAP Injection in Central Dogma Server Authentication

An LDAP injection vulnerability exists in the centraldogma-server-auth-shiro module of LY Corporation Central Dogma before version 0.84.0. The search logic dynamically constructs LDAP search filters by interpolating user-provided usernames without escaping RFC 4515 metacharacters. Unauthenticated remote attackers can leverage this flaw to bypass authentication, enumerate directory hierarchies, and access unauthorized resources.

Alon Barad
Alon Barad
9 views•6 min read
•1 day ago•CVE-2026-11746
9.4

CVE-2026-11746: Use of Hard-coded ZooKeeper Replication Secret 'ch4n63m3' in Central Dogma Server

CVE-2026-11746 is a critical vulnerability in Central Dogma Server prior to version 0.84.0, where an embedded ZooKeeper replication secret silently falls back to a publicly known, hard-coded default string ('ch4n63m3'). Remote attackers with access to the replication network can authenticate as legitimate cluster peers, potentially leading to unauthorized data exposure, state manipulation, or complete cluster takeover.

Amit Schendel
Amit Schendel
7 views•6 min read
•1 day ago•CVE-2026-56665
4.2

CVE-2026-56665: Logical Validation Bypass in ZITADEL External JWT Identity Provider

A logical verification flaw in ZITADEL's external JWT Identity Provider validation allows attackers to bypass session expiration checks. If an incoming JWT lacks the 'exp' claim, the system skips validation entirely, creating an indefinitely valid session. This issue has been addressed in versions 3.4.12 and 4.15.2.

Alon Barad
Alon Barad
6 views•7 min read
•1 day ago•CVE-2026-59149
6.5

CVE-2026-59149: Sibling Directory Path Traversal in Mockoon Backend Server

CVE-2026-59149 identifies a directory traversal vulnerability in `@mockoon/commons-server`, the backend mock-server library powering the Mockoon application. The flaw occurs in the path containment validation logic used during raw file response generation. An unauthenticated attacker can exploit this weakness to retrieve arbitrary files from sibling directories sharing a common prefix with the designated static base directory.

Amit Schendel
Amit Schendel
9 views•5 min read
•1 day ago•CVE-2026-59148
8.8

CVE-2026-59148: Unauthenticated Administrative API and CORS Misconfiguration in Mockoon

An in-depth analysis of CVE-2026-59148, a high-severity flaw in Mockoon where unauthenticated administrative endpoints and a wildcard Cross-Origin Resource Sharing (CORS) policy allow remote execution, state poisoning, and credential theft.

Alon Barad
Alon Barad
11 views•6 min read
•1 day ago•CVE-2026-56666
4.8

CVE-2026-56666: Account Takeover via Improper Email Verification in ZITADEL Federated Identity Handler

An improper authentication vulnerability (CWE-287) in ZITADEL's external identity provider handler before version 4.15.3 allows remote attackers to perform complete account takeover. When auto-linking by email is enabled, ZITADEL verifies that the local target account has a verified email address but fails to verify if the external provider confirmed ownership of that same email. Attackers can exploit this by registering an unverified account with a victim's email address on a permissive external provider, leading to unauthorized account binding and persistent access.

Amit Schendel
Amit Schendel
7 views•7 min read