Baja

Tornado: Open redirect in RedirectHandler via protocol-relative URLs

  • Publicada: 28.10.2026
  • Actualizado: 29.10.2026 01:17

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

Software afectado

Haz clic en una tecnología para ver todas sus vulnerabilidades.

PlataformaPaqueteVersiones vulnerablesCorregida en
Python (PyPI) tornado < 6.6 6.6

Referencias

Puntuación CVSS -
Vector 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
Debilidad (CWE)
CWE-601
Plataforma
Python (PyPI)
Paquete
tornado
Publicada
28.10.2026
Actualizado
29.10.2026 01:17

Fuentes y licencias

OSV / GitHub Advisory Database - GHSA-pw9p-v7r6-gx4p - CC BY 4.0

Historial de vulnerabilidades: tornado

Todas las vulnerabilidades publicadas de este paquete (Python (PyPI)), de la más reciente a la más antigua. Muestra si es un fallo aislado o un paquete que hay que vigilar.

Todas (27) en el archivo
Entradas en total
27
Primera → última
05.2012 11.2026
Sin corrección
0
Explotada en ataques
0

Distribución por gravedad

  • Alta 13
  • Media 10
  • Baja 4

Divulgaciones por año

  1. 2017: 0
  2. 2018: 0
  3. 2019: 0
  4. 2020: 1
  5. 2021: 0
  6. 2022: 0
  7. 2023: 2
  8. 2024: 3
  9. 2025: 4
  10. 2026: 16

antes: 1

Gravedad:
  1. Tornado: Open redirect in RedirectHandler via protocol-relative URLs esta entrada
    Baja CVE-2026-116578 < 6.6 6.6
  2. Alta · 7.5 CVE-2026-31958 < 6.5.5 6.5.5
  3. Alta · 7.5 CVE-2025-67726 < 6.5.3 6.5.3
  4. Alta · 7.5 CVE-2025-67725 < 6.5.3 6.5.3
  5. Alta · 7.5 CVE-2024-52804 < 6.4.2 6.4.2

Identifica las vulnerabilidades de tu aplicación

Con la integración de DockRay y el inventario de software activado, DockRay compara las versiones notificadas de los componentes con las vulnerabilidades conocidas y avisa de las coincidencias confirmadas. La cobertura depende de la tecnología compatible y de los avisos disponibles.

Conectar tu aplicación
Newsletter DockRay

La seguridad de tus aplicaciones en tu correo

Vulnerabilidades importantes, recomendaciones concretas y consejos prácticos para tus aplicaciones. Elige tus tecnologías y sigue lo que importa para tu proyecto.

  • Un resumen diario de nuevas vulnerabilidades, también las críticas.
  • Avisos sobre actualizaciones importantes.
  • Consejos prácticos sobre seguridad y monitorización de aplicaciones.

Déjalo vacío para recibir avisos de todas las tecnologías.

Suscripción gratuita. Date de baja con un clic en cualquier correo.