Executive brief
Daphne, a popular web server for Django applications, is vulnerable to a header smuggling flaw during WebSocket handshakes. An attacker can use non-standard characters to trick the server into processing hidden headers, potentially bypassing security controls or accessing unauthorized data. This issue affects how the server communicates with the application, but it requires specific conditions to exploit and has been fixed in the latest version.
Technical details
Daphne (before version 4.2.2) reconstructs raw HTTP requests from Twisted's parsed headers and passes them to the Autobahn library for WebSocket handshake processing. A parser differential exists because Twisted does not recognize certain non-standard bytes (such as \x0b, \x0c, \x1c, \x1d, \x1e, or \x85) as line separators, whereas Autobahn's splitlines() method does. An unauthenticated remote attacker can use these characters to smuggle additional headers into the ASGI scope passed to the application. The vulnerability is classified as CWE-444 (HTTP Request/Response Smuggling) and has been addressed in version 4.2.2 by rejecting requests containing these bytes in header values.
Affected products
- Django Software Foundation daphne < 4.2.2
Timeline
- 2026-06-03: advisory
- 2026-06-03: disclosed
- 2026-06-03: patched: Version 4.2.2 released