An Open Redirect vulnerability exists in Taguette that allows attackers to craft malicious URLs that redirect users to arbitrary external websites after authentication. This can be exploited for phishing attacks where victims believe they are interacting with a trusted Taguette instance but are redirected to a malicious site designed to steal credentials or deliver malware.
Severity: Medium to High
The application accepts a user-controlled next parameter and uses it directly in HTTP redirects without any validation. The vulnerable code is located in two places:
taguette/web/views.py, lines 140-144)def _go_to_next(self):
next_ = self.get_argument('next', '')
if not next_:
next_ = self.reverse_url('index')
return self.redirect(next_) # ← No validation of next_ parameter
This method is called after successful login (line 132) and when an already-logged-in user visits the login page (line 109).
taguette/web/views.py, lines 79-85)def post(self):
self.set_cookie('cookies_accepted', 'yes', dont_check=True)
next_ = self.get_argument('next', '')
if not next_:
next_ = self.reverse_url('index')
return self.redirect(next_) # ← No validation of next_ parameter
In both cases, if next_ is provided by the user, it is passed directly to self.redirect() without checking whether it points to the same host or is a relative URL.
Simply replace [your-taguette-instance] with your Taguette server domain and test these URLs in your browser:
https://[your-taguette-instance]/cookies?next=https://google.com
https://google.com (external site)https://[your-taguette-instance]/login?next=https://google.com
https://google.com (external site)https://[your-taguette-instance]/login?next=https://google.com
https://google.comNote: We use
google.comas a safe external site for testing. In a real attack, this would be a phishing site.
next parameterThe vulnerability is particularly dangerous because: 1. The login page displayed is completely legitimate, building victim trust 2. Users have just entered their credentials, making them more likely to enter them again on a fake "session expired" page 3. The trusted domain in the URL makes the attack more convincing
Validate that the next parameter is either a relative URL or points to the same host before redirecting.
Add a validation function:
from urllib.parse import urlparse
def is_safe_url(url, host):
"""Check if URL is safe for redirect (relative or same host)."""
if not url:
return False
parsed = urlparse(url)
# Reject protocol-relative URLs (//evil.com)
if url.startswith('//'):
return False
# Allow relative URLs (no scheme and no netloc)
if not parsed.scheme and not parsed.netloc:
return True
# Allow same-host URLs
return parsed.netloc == host
Then update the vulnerable methods:
def _go_to_next(self):
next_ = self.get_argument('next', '')
if not next_ or not is_safe_url(next_, self.request.host):
next_ = self.reverse_url('index')
return self.redirect(next_)
Apply the same fix to the CookiesPrompt.post() method.
{
"severity": "MODERATE",
"github_reviewed": true,
"nvd_published_at": null,
"github_reviewed_at": "2025-12-09T14:26:34Z",
"cwe_ids": [
"CWE-601"
]
}