CVE-2026-116578: Tornado: Open redirect in RedirectHandler via protocol-relative URLs

Published Oct 26, 2026
·
Updated

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

Other sources

Tornado is a Python web framework and asynchronous networking library. Prior to 6.6, tornado.web.RedirectHandler URL templates can place regex-capture substitutions where crafted request paths change the redirect scheme or network location. Affected placements include substitutions at the start of a path, directly after a fixed host, or at the beginning of the template, including protocol-relative, absolute, backslash, encoded, host-extension, and user-info variants interpreted by browsers as attacker-controlled destinations. Static templates and substitutions after a fixed host followed by a slash are not affected. An attacker can use the resulting open redirect on the application's domain for phishing. This issue is fixed in version 6.6.

— Ubuntu

Affected Software

12 affected componentsFixes available
pip/tornado<6.6
6.6
ubuntu/python-tornado*
ubuntu/python-tornado*
ubuntu/python-tornado*
ubuntu/python-tornado*
ubuntu/python-tornado*
ubuntu/python-tornado*
ubuntu/python-tornado*
debian/python-tornado*
debian/python-tornado*
debian/python-tornado<6.6.0-1
6.6.0-1
debian/python-tornado<=6.2.0-3+deb12u4, <=6.4.2-3+deb13u2
6.6.0-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/tornado to a version that resolves this vulnerability.

    Fixed in 6.6
  2. Upgrade

    Upgrade debian/python-tornado to a version that resolves this vulnerability.

    Fixed in 6.6.0-1
  3. Upgrade

    Upgrade Tornado to a version that resolves this vulnerability.

    Fixed in 6.6
  4. Configuration

    Change RedirectHandler URL templates so substitutions cannot influence the scheme or host; place them after a fixed host and slash, or use capture-group regexes that cannot match '/', '\\', '@', '.', or ':' where those characters could affect the host.

    tornado.web.RedirectHandler URL template substitutions = Place every substitution after a fixed prefix ending in '/'

Event History

Oct 26, 2026
CVE Published
via Ubuntu·12:00 AM
Data Sourced
via Ubuntu·12:00 AM
RemedyDescriptionSeverityAffected Software
CVE Published
via MITRE·08:22 PM
Data Sourced
via MITRE·08:22 PM
DescriptionWeakness
Data Sourced
via OSV·08:22 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·09:18 PM
DescriptionSeverityWeakness
Oct 28, 2026
Advisory Published
via GitHub·10:43 PM
Data Sourced
via GitHub·10:43 PM
DescriptionWeaknessAffected Software
Nov 12, 2026
Data Sourced
via OSV·05:25 PM
Affected Software

Frequently Asked Questions

1

Which Tornado applications are exposed to this redirect?

Applications are affected only if they use tornado.web.RedirectHandler with a URL template in which a regex capture group can control the redirect scheme or host. Examples include substitutions at the beginning of a path, immediately after a host, or templates that begin with a substitution.

2

What does an attacker need to exploit the issue?

An attacker needs to induce a user to request a crafted application URL that matches a vulnerable RedirectHandler route. No authentication is indicated, but user interaction is required because the primary impact is redirecting the user to an attacker-chosen site.

3

Are protocol-relative URLs the only bypass technique to consider?

No. In addition to URLs beginning with //, backslashes and encoded characters can produce equivalent behavior in browsers. Capture-group substitutions directly after a host can also be abused with values such as .evil.com/ or @evil.com/.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203