Tornado: Open redirect in RedirectHandler via protocol-relative URLs
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 tohttps://example.com//evil.com/targetredirects 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
RedirectHandlertemplates 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
RedirectHandlerwith a custom handler that validates the target before callingself.redirect().
Credit
Reported by Longwei Wang (@gn00295120).
Czego dotyczy
Kliknij technologię, aby zobaczyć wszystkie dotyczące jej podatności.
| Platforma | Paczka | Podatne wersje | Poprawka w wersji |
|---|---|---|---|
| Python (PyPI) | tornado | < 6.6 | 6.6 |
Odnośniki
- https://github.com/tornadoweb/tornado/security/advisories/GHSA-pw9p-v7r6-gx4p
- https://nvd.nist.gov/vuln/detail/CVE-2026-116578
- https://github.com/tornadoweb/tornado/pull/3786
- https://github.com/tornadoweb/tornado/commit/940ea725bdd9bc68231d68a105eef17ea6e11233
- https://github.com/tornadoweb/tornado/commit/cc75ab0eb3af459c714895a49f682ad354f50117
- https://github.com/tornadoweb/tornado/commit/ccb6a2e5482f17997efd4a74b8200d5b4babc035
- https://github.com/tornadoweb/tornado
- https://github.com/tornadoweb/tornado/releases/tag/v6.6.0
- Wektor CVSS
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- Słabość (CWE)
CWE-601- Platforma
- Python (PyPI)
- Paczka
tornado- Ujawniono
- 28.10.2026
- Aktualizacja
- 29.10.2026 01:17
Źródła i licencje
OSV / GitHub Advisory Database - GHSA-pw9p-v7r6-gx4p - CC BY 4.0
Historia podatności: tornado
Wszystkie opisane podatności tej paczki (Python (PyPI)), od najnowszej. Widać, czy to jednorazowa wpadka, czy paczka, której trzeba pilnować.
- Wszystkich wpisów
- 27
- Pierwsza → ostatnia
- 05.2012 11.2026
- Bez poprawki
- 0
- Wykorzystywana w atakach
- 0
Rozkład istotności
- Wysoka 13
- Średnia 10
- Niska 4
Ujawnienia w latach
- 2017: 0
- 2018: 0
- 2019: 0
- 2020: 1
- 2021: 0
- 2022: 0
- 2023: 2
- 2024: 3
- 2025: 4
- 2026: 16
wcześniej: 1
-
Tornado: Open redirect in RedirectHandler via protocol-relative URLs ten wpis
Dowiedz się, które podatności dotyczą Twojej aplikacji
Po podłączeniu integracji DockRay i włączeniu raportowania oprogramowania DockRay porównuje zgłoszone wersje komponentów ze znanymi podatnościami i powiadamia o potwierdzonych dopasowaniach. Zakres zależy od obsługiwanej technologii i dostępnych biuletynów.