VAITP Dataset

← Back to the dataset

CVE-2026-116578

Open redirect via crafted paths in Tornado RedirectHandler before 6.6.

  • CVSS 2.1
  • CWE-601
  • Input Validation and Sanitization
  • Remote

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.

CVSS base score
2.1
Published
2026-10-26
OWASP
A01 Broken Access Control
Orthogonal defect classification
Interface
Code defect classification
Incorrect Interface
Category
Input Validation and Sanitization
Subcategory
Insecure Parsing or Deserialization
Accessibility scope
Remote
Impact
Unauthorized Access
Affected component
Tornado
Fixed by upgrading
Yes

Solution

Upgrade Tornado to version 6.6 or later.

Vulnerable code sample

import tornado.ioloop
import tornado.web

class OpenRedirectHandler(tornado.web.RequestHandler):
    # VULNERABLE: uses user-controlled path in redirect template
    def get(self):
        # The template allows regex capture substitution that can alter scheme or host
        target = self.get_argument("next", "/")
        self.redirect(f"/redirect/{target}")

def make_app():
    return tornado.web.Application([
        (r"/open", OpenRedirectHandler),
    ])

def main():
    app = make_app()
    app.listen(8888)
    tornado.ioloop.IOLoop.current().start()

Patched code sample

import tornado.ioloop
import tornado.web
import urllib.parse

class OpenRedirectHandler(tornado.web.RequestHandler):
    # FIX: validates that the redirect target is a relative path on the same host
    def get(self):
        target = self.get_argument("next", "/")
        parsed = urllib.parse.urlparse(target)
        # Reject absolute URLs or scheme changes
        if parsed.scheme or parsed.netloc:
            target = "/"
        self.redirect(f"/redirect/{target}")

def make_app():
    return tornado.web.Application([
        (r"/open", OpenRedirectHandler),
    ])

def main():
    app = make_app()
    app.listen(8888)
    tornado.ioloop.IOLoop.current().start()

Published fix

Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.

Cite this entry

@misc{vaitp:cve2026116578,
  title        = {{Open redirect via crafted paths in Tornado RedirectHandler before 6.6.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-116578},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-116578/}}
}

Download this entry as JSON Download the whole dataset

Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.

The supreme art of war is to subdue the enemy without fighting.

Sun Tzu – “The Art of War”

:: Shaping the future through research and ingenuity ::

Before you use the VAITP AI models

Please read and accept the following disclaimer:

By choosing "I understand and accept", you acknowledge that you understand and agree to these terms.