GHSA-8r99-h8j2-rw64: Twisted Twisted Vulnerable To HTTP Request Vulnerability

MODERATE
Published
Advisory Summary

GHSA-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

CVE Identifier N/A
GHSA Identifier GHSA-8r99-h8j2-rw64
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Twisted
Package Ecosystem PyPI
Published Date
Last Updated

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.

twisted fixed: 20.3.0
pip install twisted>=20.3.0
Verify Direct and Transitive Dependencies

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

### Impact Twisted Web is vulnerable to request smuggling attacks: 1. "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) 2. " 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) 3. ~"Twisted should not allow BWS between the filed-name and colon." (ZeddYu Lu)~ _closed in 9646_ 4. "Two CL header with different values is also not allowed." (ZeddYu Lu) 5. "Only accept identity and chunked Transport-Encoding." (ZeddYu Lu) ### Patches https://github.com/twisted/twisted/commit/20c787a14a09e7cbd5dfd8df08ceff00d1fcc081 https://github.com/twisted/twisted/commit/4a7d22e490bb8ff836892cc99a1f54b85ccb0281 ### Workarounds N/A ### References https://portswigger.net/web-security/request-smuggling

GHSA-8r99-h8j2-rw64 Affected Twisted Versions

1 component(s)
Fixed Versions:
20.3.0
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?
GHSA-8r99-h8j2-rw64 is a security vulnerability in Twisted involving Twisted vulnerable to HTTP Request Smuggling Attacks under General Security Weakness.
Which Twisted versions are affected?
Affected versions include releases prior to 20.3.0 across affected packages: twisted.
What version fixes GHSA-8r99-h8j2-rw64?
Upgrading to 20.3.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is twisted affected?
Yes, twisted is affected in releases prior to 20.3.0. Upgrade your dependency to 20.3.0 or later.
What CWE is associated with GHSA-8r99-h8j2-rw64?
GHSA-8r99-h8j2-rw64 is classified under General Security Weakness.
How can I check PyPI dependencies for GHSA-8r99-h8j2-rw64?
Run the dependency tree command: 'pip show twisted'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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
  }
}