GHSA-8r99-h8j2-rw64: Twisted Twisted Vulnerable To HTTP Request Vulnerability
MODERATEGHSA-8r99-h8j2-rw64 is a MODERATE twisted vulnerable to http request vulnerability (General Security Weakness) affecting Twisted libraries in the PyPI ecosystem. The issue involves twisted vulnerable to http request smuggling attacks. Remediation is available by upgrading affected packages to version 20.3.0.
GHSA-8r99-h8j2-rw64 at a Glance
How to Fix GHSA-8r99-h8j2-rw64
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>=20.3.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 GHSA-8r99-h8j2-rw64, 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 20.3.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 General Security Weakness. 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
GHSA-8r99-h8j2-rw64 Affected Twisted Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
twisted
|
PyPI |
< 20.3.0
|
20.3.0
|
References
Frequently Asked Questions
What is GHSA-8r99-h8j2-rw64?
Which Twisted versions are affected?
What version fixes GHSA-8r99-h8j2-rw64?
Is twisted affected?
What CWE is associated with GHSA-8r99-h8j2-rw64?
How can I check PyPI dependencies for GHSA-8r99-h8j2-rw64?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-8r99-h8j2-rw64",
"modified" : "2022-10-07T07:31:33Z",
"published" : "2022-10-07T07:31:33Z",
"aliases" : [ ],
"summary" : "Twisted vulnerable to HTTP Request Smuggling Attacks",
"details" : "### Impact\nTwisted Web is vulnerable to request smuggling attacks:\n\n1. \"When presented with two content-length headers, Twisted Web ignored the first header. When the second content-length was set to zero this caused Twisted Web to interpret the request body as a pipelined request. According to RFC 7230 Section 3.3.3#4, if a message is received with multiple content-length headers with differing value, then the server must reject the message with a 400 response.\" (Jake Miller of Bishop Fox Security)\n2. \" When presented with a content-length and a chunked encoding header, the content-length took precedence and the remainder of the request body was interpreted by Twisted Web as a pipelined request. According to RFC 7230 Section 3.3.3#3, if a message with both content-length and chunked encoding is accepted, transfer-encoding overrides the content-length.\" (Jake Miller of Bishop Fox Security)\n3. ~\"Twisted should not allow BWS between the filed-name and colon.\" (ZeddYu Lu)~ _closed in 9646_\n4. \"Two CL header with different values is also not allowed.\" (ZeddYu Lu)\n5. \"Only accept identity and chunked Transport-Encoding.\" (ZeddYu Lu)\n\n### Patches\nhttps://github.com/twisted/twisted/commit/20c787a14a09e7cbd5dfd8df08ceff00d1fcc081\nhttps://github.com/twisted/twisted/commit/4a7d22e490bb8ff836892cc99a1f54b85ccb0281\n\n### Workarounds\nN/A\n\n### References\nhttps://portswigger.net/web-security/request-smuggling\n",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "twisted"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "20.3.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/twisted/twisted/security/advisories/GHSA-8r99-h8j2-rw64"
}, {
"type" : "WEB",
"url" : "https://github.com/twisted/twisted/commit/20c787a14a09e7cbd5dfd8df08ceff00d1fcc081"
}, {
"type" : "WEB",
"url" : "https://github.com/twisted/twisted/commit/4a7d22e490bb8ff836892cc99a1f54b85ccb0281"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/twisted/twisted"
} ],
"database_specific" : {
"cwe_ids" : [ ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2022-10-07T07:31:33Z",
"nvd_published_at" : null
}
}