GHSA-qppv-j76h-2rpx: Tornado Tornado Vulnerable To HTTP Request Vulnerability
MODERATEGHSA-qppv-j76h-2rpx is a MODERATE tornado vulnerable to http request vulnerability (CWE-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling')) affecting Tornado libraries in the PyPI ecosystem. The issue involves tornado vulnerable to http request smuggling via improper parsing of `content-length` fields and chunk lengths. Remediation is available by upgrading affected packages to version 6.3.3.
GHSA-qppv-j76h-2rpx at a Glance
How to Fix GHSA-qppv-j76h-2rpx
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.3.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 GHSA-qppv-j76h-2rpx, 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.3.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-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling'), where the product acts as an intermediary http agent (such as a proxy or firewall) in the data flow between two entities such as a client and server, but it does not interpret malformed http requests or responses in ways that are consistent with how the messages will be processed by those entities that are at the ultimate destination. 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
GHSA-qppv-j76h-2rpx Affected Tornado Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
tornado
|
PyPI |
< 6.3.3
|
6.3.3
|
References
Frequently Asked Questions
What is GHSA-qppv-j76h-2rpx?
Which Tornado versions are affected?
What version fixes GHSA-qppv-j76h-2rpx?
Is tornado affected?
What CWE is associated with GHSA-qppv-j76h-2rpx?
How can I check PyPI dependencies for GHSA-qppv-j76h-2rpx?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-qppv-j76h-2rpx",
"modified" : "2023-08-14T21:34:17Z",
"published" : "2023-08-14T21:34:17Z",
"aliases" : [ ],
"summary" : "Tornado vulnerable to HTTP request smuggling via improper parsing of `Content-Length` fields and chunk lengths",
"details" : "## Summary\nTornado interprets `-`, `+`, and `_` in chunk length and `Content-Length` values, which are not allowed by the HTTP RFCs. This can result in request smuggling when Tornado is deployed behind certain proxies that interpret those non-standard characters differently. This is known to apply to older versions of haproxy, although the current release is not affected.\n\n## Details\nTornado uses the `int` constructor to parse the values of `Content-Length` headers and chunk lengths in the following locations:\n### `tornado/http1connection.py:445`\n```python3\n self._expected_content_remaining = int(headers[\"Content-Length\"])\n```\n### `tornado/http1connection.py:621`\n```python3\n content_length = int(headers[\"Content-Length\"]) # type: Optional[int]\n```\n### `tornado/http1connection.py:671`\n```python3\n chunk_len = int(chunk_len_str.strip(), 16)\n```\nBecause `int(\"0_0\") == int(\"+0\") == int(\"-0\") == int(\"0\")`, using the `int` constructor to parse and validate strings that should contain only ASCII digits is not a good strategy. \n\n",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "tornado"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "6.3.3"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/tornadoweb/tornado/security/advisories/GHSA-qppv-j76h-2rpx"
}, {
"type" : "WEB",
"url" : "https://github.com/tornadoweb/tornado/commit/b7a5dd29bb02950303ae96055082c12a1ea0a4fe"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/tornadoweb/tornado"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-444" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2023-08-14T21:34:17Z",
"nvd_published_at" : null
}
}