CVE-2026-115877
Twisted HTTPChannel allows bare CR/LF in headers, enabling request smuggling.
- CVSS 5.4
- CWE-444
- Input Validation and Sanitization
- Remote
Twisted is an event-based framework for internet applications, supporting Python 3.6+. Prior to 26.10.0rc1, twisted.web.http.HTTPChannel.headerReceived rejects a NUL byte in an HTTP header value but accepts a bare carriage return or bare line feed. Because Twisted splits header lines only on CRLF, a hidden Content-Length header can remain folded into another value while a lenient front end treats the bare character as a line terminator. The resulting framing disagreement can smuggle a following request past front-end access controls, poison a shared connection or cache, and expose a later client to the wrong response. This issue is an incomplete-fix residual of earlier Twisted request-smuggling protections. This issue is fixed in version 26.10.0rc1.
- CWE
- CWE-444
- CVSS base score
- 5.4
- Published
- 2026-10-23
- OWASP
- A04 Insecure Design
- Orthogonal defect classification
- Checking
- Code defect classification
- Incorrect Check
- Category
- Input Validation and Sanitization
- Subcategory
- Insecure Parsing or Deserialization
- Accessibility scope
- Remote
- Impact
- Unauthorized Access
- Affected component
- Twisted
- Fixed by upgrading
- Yes
Solution
Upgrade Twisted to version 26.10.0rc1 or newer.
Vulnerable code sample
from twisted.web.http import HTTPChannel
class MyChannel(HTTPChannel):
def headerReceived(self, line):
# VULNERABLE: accepts bare CR or LF as line terminator, enabling header smuggling
if b'\x00' in line:
raise ValueError("Header contains NUL byte")
# Original implementation splits only on CRLF; we mimic the vulnerable behavior
name, sep, value = line.partition(b':')
if not sep:
raise ValueError("Malformed header")
self.headers[name.strip().lower()] = value.lstrip()Patched code sample
from twisted.web.http import HTTPChannel
class MyChannel(HTTPChannel):
def headerReceived(self, line):
# FIX: reject bare CR or LF to prevent header smuggling
if b'\x00' in line or b'\r' in line or b'\n' in line:
raise ValueError("Header contains prohibited control byte")
name, sep, value = line.partition(b':')
if not sep:
raise ValueError("Malformed header")
self.headers[name.strip().lower()] = value.lstrip()Published fix
Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.
- web: check a header value for NUL CR and LF in one pass (twisted/twisted)
src/twisted/web/http.py · HTTPChannel.headerReceived - Reject a bare CR or LF in an HTTP header value (#12754) (twisted/twisted)
src/twisted/web/http.py · HTTPChannel.headerReceived
Cite this entry
@misc{vaitp:cve2026115877,
title = {{Twisted HTTPChannel allows bare CR/LF in headers, enabling request smuggling.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-115877},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-115877/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
