CVE-2025-67724: Tornado Cross-Site Scripting Vulnerability
MODERATECVE-2025-67724 is a MODERATE (CVSS 5.4) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Tornado libraries in the PyPI ecosystem. The issue involves tornado vulnerable to header injection and xss via reason argument. Remediation is available by upgrading affected packages to version 6.5.3.
CVE-2025-67724 at a Glance
Security Impact
CVSS: 5.4
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N).
How to Fix CVE-2025-67724
To remediate this vulnerability, upgrade all affected Tornado dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install tornado>=6.5.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show tornado
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2025-67724, inspect your installed packages using pip:
pip show tornado
Analyze the terminal output to locate any version of Tornado in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 6.5.3), your application is affected.
Note: The pip show tornado command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Tornado, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2025-67724 Affected Tornado Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
tornado
|
PyPI |
< 6.5.3
|
6.5.3
|
References
Frequently Asked Questions
What is CVE-2025-67724?
Which Tornado versions are affected?
What version fixes CVE-2025-67724?
Is tornado affected?
What is the CVSS score of CVE-2025-67724?
What CWE is associated with CVE-2025-67724?
How can I check PyPI dependencies for CVE-2025-67724?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-pr2v-jx2c-wg9f",
"modified" : "2026-07-20T18:55:11Z",
"published" : "2026-07-20T18:55:11Z",
"aliases" : [ "CVE-2025-67724" ],
"summary" : "Tornado vulnerable to Header Injection and XSS via reason argument",
"details" : "# Header injection and XSS via `reason` argument\n\n## Summary\n\nThe `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.\n\n## Details\n\nIn 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).\n\n## Impact\n\n* **Type:** Reflected Cross-Site Scripting (CWE-79) in default error page, or header injection (CWE-644)\n* **Actors:** Remote attacker who can cause the application to raise `HTTPError`/`set_status` with an attacker-controlled `reason` (e.g., via query parameter used by developer).\n* **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.\n* **Scope:** Only applications that explicitly reflect untrusted input into `reason` are affected.\n\n## Mitigation\n\nAside 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.\n\nFor a general-purpose error message in HTTPError, consider using the `log_message` argument instead of `reason`.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "tornado"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "6.5.3"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/tornadoweb/tornado/security/advisories/GHSA-pr2v-jx2c-wg9f"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-67724"
}, {
"type" : "WEB",
"url" : "https://github.com/tornadoweb/tornado/commit/9c163aebeaad9e6e7d28bac1f33580eb00b0e421"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/tornado/PYSEC-2025-265.yaml"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/tornadoweb/tornado"
}, {
"type" : "WEB",
"url" : "https://github.com/tornadoweb/tornado/releases/tag/v6.5.3"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-07-20T18:55:11Z",
"nvd_published_at" : "2025-12-12T06:15:41Z"
}
}