{"id":"CVE-2026-116578","aliases":["CVE-2026-116578","GHSA-pw9p-v7r6-gx4p"],"related":[],"kind":"vulnerability","state":"published","title":"Tornado: Open redirect in RedirectHandler via protocol-relative URLs","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Summary\n\n`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.\n\n### Impact\n\nApplications 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:\n\n- **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 `//`.\n- **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.\n- **A template that begins with a substitution** (such as `\"{0}\"`), which can be given an absolute URL.\n\nApplications 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.\n\n### Patches\n\nFixed 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.\n\n### Workarounds\n\n- 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.\n- Alternatively, replace `RedirectHandler` with a custom handler that validates the target before calling `self.redirect()`.\n\n### Credit\n\nReported by Longwei Wang (@gn00295120).","format":"markdown","source":"ghsa"}],"published":"2026-10-26T20:22:32.217Z","modified":"2026-10-30T15:16:46.370Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":2.1,"rating":"LOW"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":2.1,"rating":"LOW"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"LOW"}],"cwes":["CWE-601"],"affected":[{"ranges":[{"version":"< 6.6","status":"affected"}],"vendor":"tornadoweb","product":"tornado","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"6.6"}],"ecosystem":"PyPI","package":"tornado","purl":"pkg:pypi/tornado","source":"ghsa"}],"references":[{"url":"https://github.com/tornadoweb/tornado/security/advisories/GHSA-pw9p-v7r6-gx4p","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/tornadoweb/tornado/pull/3786","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/tornadoweb/tornado/commit/940ea725bdd9bc68231d68a105eef17ea6e11233","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/tornadoweb/tornado/commit/cc75ab0eb3af459c714895a49f682ad354f50117","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/tornadoweb/tornado/commit/ccb6a2e5482f17997efd4a74b8200d5b4babc035","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/tornadoweb/tornado/releases/tag/v6.6.0","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-116578","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/tornadoweb/tornado","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-10-30T14:28:17.724Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-116578","url":"https://www.cve.org/CVERecord?id=CVE-2026-116578","licence":"CVE Terms of Use","modified":"2026-10-30T14:28:27.285Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-pw9p-v7r6-gx4p","url":"https://github.com/advisories/GHSA-pw9p-v7r6-gx4p","licence":"CC-BY-4.0","modified":"2026-10-28T23:00:04.066Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-116578","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-116578","licence":"Public domain","modified":"2026-10-30T15:16:46.370Z"}],"updatedAt":"2026-11-25T22:59:47.271Z","epss":{"score":0.00454,"percentile":0.41096,"date":"2026-12-01T12:00:22.000Z"}}