CVE-2023-54397 — Vulnerability in tornado — CVE Details
Tornado vulnerable to HTTP request smuggling via improper parsing of `Content-Length` fields and chunk lengths
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (0.39%). Schedule for your next planned update.
Does your project use an affected tornado version?
Paste your requirements.txt to check it for CVE-2023-54397 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
Summary
Tornado interprets -, +, and _ in chunk length and Content-Length values, which are not allowed by the HTTP RFCs. This can result in request smuggling when Tornado is deployed behind certain proxies that interpret those non-standard characters differently. This is known to apply to older versions of haproxy, although the current release is not affected.
Details
Tornado uses the int constructor to parse the values of Content-Length headers and chunk lengths in the following locations:
tornado/http1connection.py:445
self._expected_content_remaining = int(headers["Content-Length"])
tornado/http1connection.py:621
content_length = int(headers["Content-Length"]) # type: Optional[int]
tornado/http1connection.py:671
chunk_len = int(chunk_len_str.strip(), 16)
Because int("0_0") == int("+0") == int("-0") == int("0"), using the int constructor to parse and validate strings that should contain only ASCII digits is not a good strategy.
Advisory Timeline
- First published August 14, 2023 (1200 days ago).
- Last revised September 16, 2026 — 1128 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
pip install "tornado>=6.3.3"
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (1)
Affects 1 ecosystem: PyPI (1).
| Package | Fixed In |
|---|---|
| tornado PyPI · Affected: 0.2, 1.0, 1.1, 1.1.1 (+65 more) | 6.3.3 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-444
References
Frequently Asked Questions
- What is CVE-2023-54397?
- Tornado vulnerable to HTTP request smuggling via improper parsing of `Content-Length` fields and chunk lengths. This vulnerability has been assigned a severity rating of MEDIUM.
- How do I check if my project is affected by CVE-2023-54397?
- CVE-2023-54397 affects tornado. It has a 0.4% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2023-54397 and 200,000+ other known vulnerabilities.
Severity & Exploitability
This is a below-median EPSS score — only 25.2% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.
Also Known As
Related CVEs
- CVE-2026-82397HIGH
Tornado: Urlencoded body parsing omits max_num_fields, so one request can stall the event loop
- CVE-2026-31958HIGH
Tornado is vulnerable to DoS due to too many multipart parts
- CVE-2026-116577MEDIUM
Tornado: Quadratic CPU usage when parsing HTTP headers with line folding
- CVE-2025-67724MEDIUM
Tornado vulnerable to Header Injection and XSS via reason argument
- CVE-2026-91992MEDIUM
Tornado: CurlAsyncHTTPClient leaks per-request credentials on handle reuse
- CVE-2026-115927MEDIUM
Tornado: Event loop blocking and excess memory use from chunked bodies with many small chunks
- CVE-2024-58384MEDIUM
Tornado has a CRLF injection in CurlAsyncHTTPClient headers
- CVE-2026-116578LOW
Tornado: Open redirect in RedirectHandler via protocol-relative URLs