MediumGHSA-qppv-j76h-2rpxCVE-2023-54397

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

Published 14 Aug 2023 · Updated 16 Sept 2026

Is your project on an affected tornado?

Private repo? Upload its lockfile instead, or connect GitHub to check every repo.

Look after several Python apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie

Affected package

Affected
<6.3.3
Fixed in
6.3.3
Update to the fixed version for your release line, for example:pip install 'tornado>=6.3.3'

Details

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.

Is GHSA-qppv-j76h-2rpx in any of your client repos?

Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected tornado, and gives you the command that fixes it.

More advisories for tornado

  • LowCVE-2026-126347Tornado: Open redirect via triple-slash redirect paths · 13 Nov 2026
  • MediumCVE-2026-115927Tornado: Event loop blocking and excess memory use from chunked bodies with many small chunks · 28 Oct 2026
  • LowCVE-2026-116578Tornado: Open redirect in RedirectHandler via protocol-relative URLs · 28 Oct 2026
  • MediumCVE-2026-116577Tornado: Quadratic CPU usage when parsing HTTP headers with line folding · 28 Oct 2026
  • MediumCVE-2026-103261Tornado: Unbounded query-string argument count allows event-loop-stalling DoS · 30 Sept 2026
  • HighCVE-2026-103262tornado: CurlAsyncHTTPClient enforces no response-size limit — decompression bomb drives unbounded memory accumulation to OOM · 30 Sept 2026
All 28 advisories for tornado

References

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.