CVE-2026-126347
Open redirect via RedirectHandler with attacker‑controlled URL template (≥3 slashes).
- CVSS 3.1
- CWE-601
- Input Validation and Sanitization
- Remote
Tornado is a Python web framework and asynchronous networking library. In versions through 6.6.0, applications using tornado.web.RedirectHandler with URL templates that allow attacker-controlled substitutions to influence the destination can be vulnerable to an open redirect using three or more leading slashes. Differences between Python’s URL parsing and browser URL interpretation allow a crafted destination to redirect a user to an attacker-controlled host. The remediation for CVE-2026-116578 in version 6.6.0 did not fully address this case. This issue is fixed in version 6.6.1.
- CWE
- CWE-601
- CVSS base score
- 3.1
- Published
- 2026-11-12
- 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
- Information Disclosure
- Affected component
- Tornado
- Fixed by upgrading
- Yes
Solution
Upgrade Tornado to version 6.6.1.
Vulnerable code sample
import tornado.ioloop
import tornado.web
class MyRedirectHandler(tornado.web.RedirectHandler):
# VULNERABLE: allows //... redirects to attacker‑controlled host
def initialize(self, url_template):
self.url_template = url_template
def get(self, *args):
# URL template may contain user input directly
target = self.url_template.format(*args)
self.redirect(target)
def make_app():
return tornado.web.Application([
(r"/go/(.*)", MyRedirectHandler, dict(url_template="/{0}")),
])
app = make_app()
tornado.ioloop.IOLoop.current().start()Patched code sample
import tornado.ioloop
import tornado.web
import urllib.parse
class MyRedirectHandler(tornado.web.RedirectHandler):
# FIX: normalizes path to prevent leading‑slash host injection
def initialize(self, url_template):
self.url_template = url_template
def get(self, *args):
raw_target = self.url_template.format(*args)
# Ensure the redirect stays on the same host by stripping leading slashes
safe_path = urllib.parse.urljoin("/", raw_target.lstrip("/"))
self.redirect(safe_path)
def make_app():
return tornado.web.Application([
(r"/go/(.*)", MyRedirectHandler, dict(url_template="/{0}")),
])
app = make_app()
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.
- web: Fix RedirectHandler open redirect with three or more leading slashes (tornadoweb/tornado)
tornado/web.py,tornado/web.py · RedirectHandler.get,tornado/web.py · _scheme_and_netloc
Cite this entry
@misc{vaitp:cve2026126347,
title = {{Open redirect via RedirectHandler with attacker‑controlled URL template (≥3 slashes).}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-126347},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-126347/}}
}
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 ::
