Summary
Tornado vulnerable to Header Injection and XSS via reason argument
Header injection and XSS via reason argument
The reason argument (used by both RequestHandler.set_status and tornado.web.HTTPError is designed to allow applications to pass custom "reason" phrases (the "Not Found" in HTTP/1.1 404 Not Found) to the HTTP status line (mainly for non-standard status codes). Vulnerabilities exist in Tornado versions prior to 6.5.3 if untrusted data is passed as the reason argument.
Details
In vulnerable versions, the supplied reason phrase is used unescaped in HTTP headers (where it could be used for header injection) or in HTML in the default error page (where it could be used for XSS).
Mitigation
Aside from upgrading to Tornado 6.5.3 or newer, the vulnerability can be mitigated by not using untrusted data for the reason argument. In the intended use case the reason argument would generally be a string literal and not derived from user input. Also, the reason argument is rarely required (reason phrases are not used at all in HTTP/2) and can generally be omitted.
For a general-purpose error message in HTTPError, consider using the log_message argument instead of reason.
Impact
- Type: Reflected Cross-Site Scripting (CWE-79) in default error page, or header injection (CWE-644)
- Actors: Remote attacker who can cause the application to raise
HTTPError/set_statuswith an attacker-controlledreason(e.g., via query parameter used by developer). - Effect: Execution of arbitrary JavaScript in victims' browsers when they view the error page, possible session token theft, CSRF escalation, UI spoofing, or other client-side attacks depending on context.
- Scope: Only applications that explicitly reflect untrusted input into
reasonare affected.
Untrusted input is rendered as active markup in a victim's browser, which can run script in their session. Typical impact: session or credential theft, and actions taken as the user.
CVE-2025-67724 has a CVSS score of 5.4 (Medium). The vector is network-reachable, no privileges required, and user interaction required. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (6.5.3); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is CVE-2025-67724? CVE-2025-67724 is a medium-severity cross-site scripting (XSS) vulnerability in tornado (pip), affecting versions < 6.5.3. It is fixed in 6.5.3. Untrusted input is rendered as active markup in a victim's browser, which can run script in their session.
- How severe is CVE-2025-67724? CVE-2025-67724 has a CVSS score of 5.4 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of tornado are affected by CVE-2025-67724? tornado (pip) versions < 6.5.3 is affected.
- Is there a fix for CVE-2025-67724? Yes. CVE-2025-67724 is fixed in 6.5.3. Upgrade to this version or later.
- Is CVE-2025-67724 exploitable, and should I be worried? Whether CVE-2025-67724 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2025-67724 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2025-67724? Upgrade
tornadoto 6.5.3 or later.