Skip to main content

CVE-2023-54397 — Vulnerability in tornado — CVE Details

MEDIUM

Tornado vulnerable to HTTP request smuggling via improper parsing of `Content-Length` fields and chunk lengths

Published August 14, 2023Updated September 16, 2026Source: OSV

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.

Check my requirements.txt

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
Update tornado to 6.3.3 or later
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).

PackageFixed 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.

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

EPSS Score (30-day exploit probability)
0.39%
EPSS percentile: 25.2

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

GHSA-qppv-j76h-2rpx

Related CVEs

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my requirements.txt