Skip to content

Update dependency tornado to v6.6 [SECURITY] - #1104

Merged
sloria merged 1 commit into
devfrom
renovate/pypi-tornado-vulnerability
Oct 31, 2026
Merged

sloria merged 1 commit into
devfrom
renovate/pypi-tornado-vulnerability

Conversation

@renovate

@renovate renovate Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
tornado (source) 6.5.9 → 6.6 age confidence

Tornado: Quadratic CPU usage when parsing HTTP headers with line folding

CVE-2026-116577 / GHSA-pcg2-g6cj-q92c

More information

Details

Summary

Tornado's HTTP header parser takes quadratic time (O(n²)) when a header value is continued across many "obsolete line folding" (obs-fold) lines. An unauthenticated attacker can send a request whose header block is mostly short continuation lines. Parsing it uses a large amount of CPU on the IOLoop thread and blocks every other connection that process is serving.

This issue is closely related to CVE-2025-67725 (GHSA-c98p-7wgm-6p64). The fix for that advisory covered repeated headers but not line-folded continuations.

Impact

All Tornado HTTP servers are affected. Header parsing runs before any application code, so no authentication or particular handler is required.

How bad it gets depends on max_header_size:

  • Default (64 KB): each malicious request blocks the event loop for tens of milliseconds. Repeated requests can degrade service.
  • Raised max_header_size: the cost grows with the square of the header size. A single 1 MB request can block the process for several seconds.

Only availability is affected. Confidentiality and integrity are not.

Patches

Fixed in Tornado 6.6 by removing support for obsolete line folding completely; header lines that begin with whitespace are now rejected.

Workarounds
  • Keep max_header_size at its default value or lower it. This limits the impact but doesn't remove it.
  • Run Tornado behind a reverse proxy that rejects or normalizes obsolete line folding before forwarding requests.
Credit

Reported by @​manus-pi.

Severity

  • CVSS Score: 5.3 / 10 (Medium)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Tornado: Open redirect in RedirectHandler via protocol-relative URLs

CVE-2026-116578 / GHSA-pw9p-v7r6-gx4p

More information

Details

Summary

tornado.web.RedirectHandler builds its target URL by substituting parts of the request path into a template. Depending on where those substitutions appear in the template, an attacker can craft a request that redirects to a host of their choosing. This creates an open redirect on the application's domain, which can be used in phishing.

Impact

Applications are affected if they use RedirectHandler with a URL template where a regex capture group can influence the scheme or host of the redirect. This includes:

  • A substitution at the start of the path, for example (r"/(.*)/target", RedirectHandler, {"url": "/{0}/destination"}). A request to https://example.com//evil.com/target redirects to //evil.com/destination, a protocol-relative URL pointing to evil.com. Variants using backslashes or encoded characters have the same effect, because browsers treat them as equivalent to //.
  • A substitution directly after the host, for example (r"/old(.*)", RedirectHandler, {"url": "https://new.example.com{0}"}). A request to /old.evil.com/ or /old@evil.com/ redirects to evil.com.
  • A template that begins with a substitution (such as "{0}"), which can be given an absolute URL.

Applications are not affected if their RedirectHandler templates use only static URLs, or if every substitution comes after a fixed host and a / (for example "/static/{0}" or "https://example.com/{0}"). Other uses of RequestHandler.redirect() are not affected by this advisory, although applications that pass user-controlled input to redirect() should validate it themselves.

Patches

Fixed in Tornado 6.6. RedirectHandler now returns a 400 error if the substituted values would change the scheme or host of the redirect from what the template specifies. As a result, substitutions can no longer be used in the scheme or host part of a template. The similar check in StaticFileHandler has also been hardened against backslash and whitespace variants.

Workarounds
  • Change RedirectHandler templates so every substitution comes after a fixed prefix ending in /, or write capture-group regexes that cannot match characters such as /, \, @, . or : where they could affect the host.
  • Alternatively, replace RedirectHandler with a custom handler that validates the target before calling self.redirect().
Credit

Reported by Longwei Wang (@​gn00295120).

Severity

  • CVSS Score: 2.1 / 10 (Low)
  • Vector String: CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:N/VI:N/VA:N/SC:N/SI:L/SA:N

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Tornado: Event loop blocking and excess memory use from chunked bodies with many small chunks

CVE-2026-115927 / GHSA-r4j5-9xpp-3985

More information

Details

Summary

When Tornado reads an HTTP/1.1 body that uses chunked transfer encoding, it processes all chunks that have already arrived without yielding to the event loop. A client can send a body made of millions of 1-byte chunks, which blocks the event loop (and therefore every other connection served by that process) for the entire time it takes to parse the body. A body near the default max_body_size of 100 MB can block the process for close to a minute, and the attacker can repeat or parallelize these requests.

Bodies made of tiny chunks also consumed far more memory than their size: a handler that does not use @stream_request_body stored each chunk as a separate object, using roughly 20 times as much memory as the bytes received.

Impact

All Tornado HTTP servers are affected when they receive a request body for a handler that reads it, which includes any handler that does not reject the request before the body is read. No authentication is required. Lowering max_body_size reduces the maximum blocking time and memory use for each request but does not remove the issue.

SimpleAsyncHTTPClient is affected in the same way when it reads a response from a malicious server.

Patches

Fixed in Tornado 6.6. Tornado now yields to the event loop periodically while reading any body, combines small chunks before passing them to data_received, and stores non-streaming bodies more compactly.

Applications using @stream_request_body should note that the pieces passed to data_received no longer correspond to HTTP chunk boundaries.

Workarounds
  • Run Tornado behind a reverse proxy that buffers request bodies and forwards them with a Content-Length header instead of chunked encoding.
  • Lower max_body_size (for the whole server or for individual handlers) to limit the impact of each request.
Credit

Reported by uttej-badwane.

Severity

  • CVSS Score: 5.3 / 10 (Medium)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Release Notes

tornadoweb/tornado (tornado)

v6.6

Compare Source

v6.5.10

Compare Source


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@sloria
sloria merged commit 97f77f8 into dev Oct 31, 2026
8 checks passed
@sloria
sloria deleted the renovate/pypi-tornado-vulnerability branch October 31, 2026 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant