Vulnerable Software
Overview
Request smuggling doesn't only arise from CL/TE parsing differences. Software-specific bugs can also cause incorrect request length parsing, leading to desynchronization.
This section covers vulnerabilities in specific software implementations that enable request smuggling attacks.
Gunicorn 20.0.4 - Sec-Websocket-Key1 Bug
Vulnerability Details
Software
Gunicorn (Python WSGI HTTP Server)
Affected Version
20.0.4
Bug
Sec-Websocket-Key1 header truncates body to 8 bytes
Impact
Request smuggling, WAF bypass
The Bug
When Gunicorn 20.0.4 encounters the Sec-Websocket-Key1 HTTP header:
It ignores the
Content-LengthheaderIt ignores the
Transfer-EncodingheaderIt forces request body length to exactly 8 bytes
This is a legacy WebSocket handshake header that triggers buggy behavior.
Why It's Exploitable
This creates desynchronization even when both systems "support" proper header parsing.
Identification
Detection Request
Request 1 (Smuggling):
Note:
xxxxxxxx= exactly 8 characters (padding for Gunicorn's forced body length)
Request 2 (Probe):
Testing Procedure
Create tab group in Burp Repeater
Send both requests via single connection
Observe responses
Expected Results
Request 1
GET /
200 OK (index page)
Request 2
GET /
404 Not Found β Smuggled!
If Request 2 returns 404 instead of 200, the smuggled /404 request was processed.
TCP Stream Analysis
Reverse Proxy View
Proxy sees: Two GET requests to /
Gunicorn View (Buggy)
Gunicorn sees: Three requests - including smuggled /404!
Exploitation - WAF Bypass
Scenario
WAF blocks requests with
adminin URLGoal: Access
/adminpanel
Exploit Requests
Request 1 (Smuggling):
Request 2 (Trigger):
Content-Length Calculation
Adjust CL to match your target hostname.
Attack Flow
Server Detection
Identifying Gunicorn
Check response headers:
Version Check
The vulnerability affects Gunicorn 20.0.4 specifically.
The 8-Byte Padding
Why xxxxxxxx?
xxxxxxxx?The Sec-Websocket-Key1 bug forces exactly 8 bytes for the body:
You can use any 8 characters:
xxxxxxxxAAAAAAAA12345678(8 spaces)
Calculation Template
Other Vulnerable Software
Known Request Smuggling CVEs
Gunicorn 20.0.4
-
Sec-Websocket-Key1 bug
HAProxy
CVE-2021-40346
Integer overflow in content-length
Apache
CVE-2022-22720
Request splitting
Node.js
CVE-2022-32215
HTTP Request Smuggling
Nginx
Various
Chunked encoding edge cases
Research Resources
Tips & Tricks
Testing Multiple Versions
When targeting unknown infrastructure:
Identify server software from headers
Research known smuggling bugs
Test version-specific payloads
Burp Configuration
Same as TE.CL:
Disable "Update Content-Length"
Create tab group
Send in sequence (single connection)
Fallback Strategy
If CL/TE techniques fail:
Check for software-specific bugs
Test unusual headers
Research CVEs for identified software
Lab Walkthrough Summary
Identify server:
Server: gunicorn/20.0.4Confirm WAF blocks
/adminTest Sec-Websocket-Key1 bug with
/404smuggleVerify Request 2 returns 404 (smuggled request processed)
Exploit by smuggling
GET /admininsteadAccess admin panel via Response 2
References
Last updated