Summary
CVE-2023-54397 is an HTTP request smuggling vulnerability in the Tornado Python web framework (TornadoServer), caused by improper parsing of Content-Length header values and chunk lengths. It affects all versions of Tornado prior to 6.3.3. When Tornado is deployed behind certain reverse proxies or load balancers, the flaw can allow an attacker to smuggle unauthorized requests past proxy-layer security controls.
Technical details
- Root cause: Tornado uses Python’s
int()constructor to parseContent-Lengthheader values and chunked-transfer chunk-size fields. Python’sint()accepts non-standard characters — such as dashes, plus signs, and underscores — that HTTP RFCs forbid in these fields. - Trigger condition: An attacker crafts an HTTP request containing a
Content-Length(or chunk length) value with these non-standard characters. A front-end proxy that parses the value strictly (per RFC) disagrees with Tornado’s lenient parsing of the same value, causing the two components to interpret request boundaries differently. - Attack vector: Network — the request is sent directly over HTTP/HTTPS to an internet-facing Tornado application, typically one sitting behind a reverse proxy or load balancer. Older versions of HAProxy are noted as being susceptible to this discrepancy.
- Impact: The parsing mismatch enables HTTP request smuggling, allowing an attacker to inject or splice requests, potentially bypassing proxy-enforced access controls, poisoning caches, or affecting other users’ requests processed through the same connection.
Affected software
- Tornado (tornadoweb/tornado), all versions prior to 6.3.3
- Fixed in Tornado 6.3.3 and later
Severity
- CVSS v3.1 Base Score: 7.5 (High) — Vector:
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:H/A:N - CVSS v4.0 Base Score: 9.0 (Critical) — Vector:
CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:L/VI:H/VA:N/SC:L/SI:H/SA:N
Mitigation and recommended actions
- Immediate: Upgrade Tornado to version 6.3.3 or later, which corrects the header and chunk-length parsing to reject non-standard characters.
- If immediate patching is not possible: Ensure any reverse proxy, load balancer, or CDN placed in front of the Tornado application enforces strict RFC-compliant parsing of
Content-Lengthand chunked-encoding values, and rejects requests containing non-numeric characters in these fields. Confirm proxy software (e.g., HAProxy) is running a version not susceptible to this parsing discrepancy.

