Mittel

Twisted: HTTP Request Smuggling in twisted.web via a Bare CR or LF in a Header Value

  • Veröffentlicht: 23.10.2026
  • Aktualisiert: 23.10.2026 23:17

Summary

An incomplete header-value validation (CWE-444) in the Twisted HTTP server lets a bare carriage return or line feed in a header value hide a following header from the parser. twisted.web.http.HTTPChannel.headerReceived rejects a NUL byte in a header value but not a bare CR or LF, even though RFC 9110 section 5.5 requires a recipient to reject all three. Because the channel splits requests only on CRLF, a value carrying a bare LF and a second header arrives as one line, so the second header is folded into the value and the request is framed with no body. A front-end that treats the bare LF as a line terminator frames the request differently, and the disagreement lets an attacker smuggle a request past it. This is an incomplete fix of the earlier Twisted request-smuggling advisories, which guarded the NUL sibling of this exact check.

Details

headerReceived splits a header line on the first colon, strips space and tab from the value, and validates it with a single test that rejects only NUL:

python
# twisted/web/http.py  HTTPChannel.headerReceived
data = data.strip(b" \t")
if b"\x00" in data:          # NUL rejected; a bare CR or LF is not
    self._respondToBadRequestAndDisconnect()
    return False

The channel delimiter is CRLF, so Foo: x\nContent-Length: 39 is one line: the split yields name Foo and value x\nContent-Length: 39, strip leaves the LF, and the NUL check passes. _maybeChooseTransferDecoder is then called with Foo, never sees a Content-Length, and installs no body decoder, so the request is framed with an empty body. The header name and request line already reject CR and LF, so the value is the only gap.

Affected product: Twisted, twisted.web.http.HTTPChannel Affected versions: 26.4.0 and earlier

PoC

Feed one connection a request whose header value carries a bare LF and a Content-Length, followed by a second request in the bytes after it: POST /public HTTP/1.1\r\nHost: v\r\nFoo: x\nContent-Length: 44\r\n\r\nGET /admin HTTP/1.1\r\nHost: internal\r\n\r\n. Twisted parses two requests and serves both, so the smuggled GET /admin returns the /admin response body even though the visible request was only POST /public. The bare CR variant behaves identically, and a NUL in the value is rejected, which isolates the missing CR and LF checks.

Behind a front-end that treats the bare LF as a line terminator, the front-end frames one POST /public and forwards a body while Twisted frames a second GET /admin; the extra response then poisons the shared connection, so a later victim receives the attacker's GET /admin response.

Impact

This is an HTTP request-smuggling exposure (CWE-444) from inconsistent interpretation of a request (CWE-436). Through a front-end that accepts a bare CR or LF as a line terminator, an attacker can smuggle a request the front-end never sees, bypassing front-end access controls, poisoning a shared connection so a later victim receives the attacker's response, and poisoning a cache. Twisted is the strict endpoint that frames the request without a body, so it is realized only behind such a proxy, and there is no code execution.

Betroffene Software

Klicken Sie auf eine Technologie, um alle zugehörigen Schwachstellen anzuzeigen.

PlattformPaketAnfällige VersionenBehoben in
Python (PyPI) twisted < 26.10.0rc1 26.10.0rc1

Verweise

CVSS-Wert 5.4/10
CVSS-Vektor
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N
Schwäche (CWE)
CWE-444
Plattform
Python (PyPI)
Paket
twisted
Veröffentlicht
23.10.2026
Aktualisiert
23.10.2026 23:17

Quellen und Lizenzen

OSV / GitHub Advisory Database - GHSA-q7qq-6mhp-9rc4 - CC BY 4.0

Schwachstellenhistorie: twisted

Alle veröffentlichten Schwachstellen dieses Pakets (Python (PyPI)), neueste zuerst. Zeigt, ob es ein einmaliger Ausrutscher ist oder ein Paket, das man im Auge behalten muss.

Alle (18) im Archiv
Einträge insgesamt
18
Erste → letzte
06.2019 10.2026
Ohne Fix
1
In Angriffen ausgenutzt
0

Verteilung nach Schweregrad

  • Kritisch 5
  • Hoch 4
  • Mittel 9

Veröffentlichungen pro Jahr

  1. 2019: 3
  2. 2020: 3
  3. 2021: 0
  4. 2022: 6
  5. 2023: 1
  6. 2024: 2
  7. 2025: 0
  8. 2026: 3
Schweregrad:
  1. Twisted: HTTP Request Smuggling in twisted.web via a Bare CR or LF in a Header Value dieser Eintrag
    Mittel · 5.4 CVE-2026-115877 < 26.10.0rc1 26.10.0rc1
  2. Kritisch · 8.1 CVE-2022-24801 < 22.4.0 22.4.0
  3. Kritisch ghsa-32gv-6cf3-wcmq < 19.10.0 19.10.0
  4. Hoch · 7.5 CVE-2022-21716 >= 21.7.0, < 22.2.0 22.2.0
  5. Hoch · 7.5 CVE-2022-21712 >= 11.1.0, < 22.1.0 22.1.0
  6. Kritisch · 9.8 CVE-2020-10109 < 20.3.0 20.3.0
  7. Kritisch · 9.8 CVE-2020-10108 < 20.3.0 20.3.0
  8. Hoch · 7.5 CVE-2014-7143 >= 14.0.0, < 14.0.1 14.0.1
  9. Kritisch · 7.4 CVE-2019-12855 < 19.7.0rc1 19.7.0rc1

Erkennen Sie Schwachstellen in Ihrer Anwendung

Mit der DockRay-Integration und aktivierter Softwareinventarisierung prüft DockRay gemeldete Komponentenversionen auf bekannte Schwachstellen und benachrichtigt Sie über bestätigte Treffer. Die Abdeckung hängt von der unterstützten Technologie und den verfügbaren Meldungen ab.

Anwendung verbinden
DockRay Newsletter

Anwendungssicherheit in Ihrem Postfach

Wichtige Schwachstellen, konkrete Empfehlungen und praktische Tipps für Ihre Anwendungen. Wählen Sie Ihre Technologien und verfolgen Sie, was für Ihr Projekt relevant ist.

  • Eine tägliche Zusammenfassung neuer Schwachstellen, auch kritischer.
  • Benachrichtigungen über wichtige Updates.
  • Praktische Tipps zur Sicherheit und Überwachung von Anwendungen.

Leer lassen, um Meldungen zu allen Technologien zu erhalten.

Kostenlos anmelden. In jeder E-Mail mit einem Klick abmelden.