CVE-2022-24801: Twisted Inconsistent Interpretation Of HTTP Requests Vulnerability
CRITICALCVE-2022-24801 is a CRITICAL (CVSS 8.1) inconsistent interpretation of http requests vulnerability (CWE-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling')) affecting Twisted libraries in the PyPI ecosystem. The issue involves inconsistent interpretation of http requests in twisted.web. Remediation is available by upgrading affected packages to version 22.4.0.
CVE-2022-24801 at a Glance
Security Impact
CVSS: 8.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2022-24801
To remediate this vulnerability, upgrade all affected Twisted 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 Twisted>=22.4.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show Twisted
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2022-24801, inspect your installed packages using pip:
pip show Twisted
Analyze the terminal output to locate any version of Twisted in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 22.4.0), your application is affected.
Note: The pip show Twisted 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 Twisted, 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-2022-24801 Affected Twisted Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
Twisted
|
PyPI |
< 22.4.0
|
22.4.0
|
References
Frequently Asked Questions
What is CVE-2022-24801?
Which Twisted versions are affected?
What version fixes CVE-2022-24801?
Is Twisted affected?
What is the CVSS score of CVE-2022-24801?
What CWE is associated with CVE-2022-24801?
How can I check PyPI dependencies for CVE-2022-24801?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-c2jg-hw38-jrqq",
"modified" : "2024-11-25T18:33:24Z",
"published" : "2022-04-04T21:29:41Z",
"aliases" : [ "CVE-2022-24801" ],
"summary" : "Inconsistent Interpretation of HTTP Requests in twisted.web",
"details" : "The Twisted Web HTTP 1.1 server, located in the `twisted.web.http` module, parsed several HTTP request constructs more leniently than permitted by RFC 7230:\n\n1. The Content-Length header value could have a `+` or `-` prefix.\n2. Illegal characters were permitted in chunked extensions, such as the LF (`\\n`) character.\n3. Chunk lengths, which are expressed in hexadecimal format, could have a prefix of `0x`.\n4. HTTP headers were stripped of all leading and trailing ASCII whitespace, rather than only space and HTAB (`\\t`).\n\nThis non-conformant parsing can lead to desync if requests pass through multiple HTTP parsers, potentially resulting in HTTP request smuggling.\n\n### Impact\n\nYou may be affected if:\n\n1. You use Twisted Web's HTTP 1.1 server and/or proxy\n2. You also pass requests through a different HTTP server and/or proxy\n\nThe specifics of the other HTTP parser matter. The original report notes that some versions of Apache Traffic Server and HAProxy have been vulnerable in the past. HTTP request smuggling may be a serious concern if you use a proxy to perform request validation or access control.\n\nThe Twisted Web client is not affected. The HTTP 2.0 server uses a different parser, so it is not affected.\n\n### Patches\n\nThe issue has been addressed in Twisted 22.4.0rc1 and later.\n\n### Workarounds\n\nOther than upgrading Twisted, you could:\n\n* Ensure any vulnerabilities in upstream proxies have been addressed, such as by upgrading them\n* Filter malformed requests by other means, such as configuration of an upstream proxy\n\n### Credits\n\nThis issue was initially reported by [Zhang Zeyu](https://github.com/zeyu2001).",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "Twisted"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "22.4.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/twisted/twisted/security/advisories/GHSA-c2jg-hw38-jrqq"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-24801"
}, {
"type" : "WEB",
"url" : "https://github.com/twisted/twisted/commit/592217e951363d60e9cd99c5bbfd23d4615043ac"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/twisted/PYSEC-2022-195.yaml"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/twisted/twisted"
}, {
"type" : "WEB",
"url" : "https://github.com/twisted/twisted/releases/tag/twisted-22.4.0rc1"
}, {
"type" : "WEB",
"url" : "https://lists.debian.org/debian-lts-announce/2022/05/msg00003.html"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/7U6KYDTOLPICAVSR34G2WRYLFBD2YW5K"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/GLKHA6WREIVAMBQD7KKWYHPHGGNKMAG6"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/7U6KYDTOLPICAVSR34G2WRYLFBD2YW5K"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/GLKHA6WREIVAMBQD7KKWYHPHGGNKMAG6"
}, {
"type" : "WEB",
"url" : "https://www.oracle.com/security-alerts/cpujul2022.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-444" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2022-04-04T21:29:41Z",
"nvd_published_at" : "2022-04-04T18:15:00Z"
}
}