ghsa-5923-r76v-mprm
Vulnerability from github
Summary
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
Details
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:
Location 1: Login Handler (taguette/web/views.py, lines 140-144)
python
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).
Location 2: Cookies Prompt Handler (taguette/web/views.py, lines 79-85)
python
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.
PoC
Simply replace [your-taguette-instance] with your Taguette server domain and test these URLs in your browser:
Test 1: Cookies Prompt Redirect
https://[your-taguette-instance]/cookies?next=https://google.com
- Open the URL above in your browser
- Click "Accept cookies" button
- Result: You are redirected to
https://google.com(external site)
Test 2: Login Redirect
https://[your-taguette-instance]/login?next=https://google.com
- Open the URL above in your browser
- Log in with valid credentials
- Result: You are redirected to
https://google.com(external site)
Test 3: Already Logged In Redirect
https://[your-taguette-instance]/login?next=https://google.com
- First, log in to Taguette normally
- Then open the URL above
- Result: You are immediately redirected to
https://google.com
Note: We use
google.comas a safe external site for testing. In a real attack, this would be a phishing site.
Impact
- Who is affected: All users of any Taguette instance running in multi-user mode
- Attack vector: Social engineering / phishing via crafted URLs
- Exploitability: Trivial - requires only crafting a URL with a malicious
nextparameter - Consequences:
- Credential theft through phishing
- Malware distribution
- Session hijacking
- Reputation damage to organizations running Taguette instances
The 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
Recommended Fix
Validate that the next parameter is either a relative URL or points to the same host before redirecting.
Example Fix
Add a validation function:
```python 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:
python
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.
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 1.5.1"
},
"package": {
"ecosystem": "PyPI",
"name": "taguette"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "1.5.2"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2025-67502"
],
"database_specific": {
"cwe_ids": [
"CWE-601"
],
"github_reviewed": true,
"github_reviewed_at": "2025-12-09T14:26:34Z",
"nvd_published_at": "2025-12-10T00:16:11Z",
"severity": "MODERATE"
},
"details": "## Summary\n\nAn 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.\n\n**Severity:** Medium to High \n\n---\n\n## Details\n\nThe 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:\n\n### Location 1: Login Handler (`taguette/web/views.py`, lines 140-144)\n\n```python\ndef _go_to_next(self):\n next_ = self.get_argument(\u0027next\u0027, \u0027\u0027)\n if not next_:\n next_ = self.reverse_url(\u0027index\u0027)\n return self.redirect(next_) # \u2190 No validation of next_ parameter\n```\n\nThis method is called after successful login (line 132) and when an already-logged-in user visits the login page (line 109).\n\n### Location 2: Cookies Prompt Handler (`taguette/web/views.py`, lines 79-85)\n\n```python\ndef post(self):\n self.set_cookie(\u0027cookies_accepted\u0027, \u0027yes\u0027, dont_check=True)\n next_ = self.get_argument(\u0027next\u0027, \u0027\u0027)\n if not next_:\n next_ = self.reverse_url(\u0027index\u0027)\n return self.redirect(next_) # \u2190 No validation of next_ parameter\n```\n\nIn 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.\n\n---\n\n[](url)\n\n\n## PoC\n\nSimply replace `[your-taguette-instance]` with your Taguette server domain and test these URLs in your browser:\n\n### Test 1: Cookies Prompt Redirect\n\n```\nhttps://[your-taguette-instance]/cookies?next=https://google.com\n```\n\n1. Open the URL above in your browser\n2. Click \"Accept cookies\" button\n3. **Result:** You are redirected to `https://google.com` (external site)\n\n### Test 2: Login Redirect\n\n```\nhttps://[your-taguette-instance]/login?next=https://google.com\n```\n\n1. Open the URL above in your browser\n2. Log in with valid credentials\n3. **Result:** You are redirected to `https://google.com` (external site)\n\n### Test 3: Already Logged In Redirect\n\n```\nhttps://[your-taguette-instance]/login?next=https://google.com\n```\n\n1. First, log in to Taguette normally\n2. Then open the URL above\n3. **Result:** You are immediately redirected to `https://google.com`\n\n\u003e **Note:** We use `google.com` as a safe external site for testing. In a real attack, this would be a phishing site.\n\n---\n\n## Impact\n\n- **Who is affected:** All users of any Taguette instance running in multi-user mode\n- **Attack vector:** Social engineering / phishing via crafted URLs\n- **Exploitability:** Trivial - requires only crafting a URL with a malicious `next` parameter\n- **Consequences:**\n - Credential theft through phishing\n - Malware distribution\n - Session hijacking\n - Reputation damage to organizations running Taguette instances\n\nThe vulnerability is particularly dangerous because:\n1. The login page displayed is completely legitimate, building victim trust\n2. Users have just entered their credentials, making them more likely to enter them again on a fake \"session expired\" page\n3. The trusted domain in the URL makes the attack more convincing\n\n---\n\n## Recommended Fix\n\nValidate that the `next` parameter is either a relative URL or points to the same host before redirecting.\n\n### Example Fix\n\nAdd a validation function:\n\n```python\nfrom urllib.parse import urlparse\n\ndef is_safe_url(url, host):\n \"\"\"Check if URL is safe for redirect (relative or same host).\"\"\"\n if not url:\n return False\n parsed = urlparse(url)\n # Reject protocol-relative URLs (//evil.com)\n if url.startswith(\u0027//\u0027):\n return False\n # Allow relative URLs (no scheme and no netloc)\n if not parsed.scheme and not parsed.netloc:\n return True\n # Allow same-host URLs\n return parsed.netloc == host\n```\n\nThen update the vulnerable methods:\n\n```python\ndef _go_to_next(self):\n next_ = self.get_argument(\u0027next\u0027, \u0027\u0027)\n if not next_ or not is_safe_url(next_, self.request.host):\n next_ = self.reverse_url(\u0027index\u0027)\n return self.redirect(next_)\n```\n\nApply the same fix to the `CookiesPrompt.post()` method.\n\n---",
"id": "GHSA-5923-r76v-mprm",
"modified": "2025-12-10T15:46:45Z",
"published": "2025-12-09T14:26:34Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/remram44/taguette/security/advisories/GHSA-5923-r76v-mprm"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-67502"
},
{
"type": "WEB",
"url": "https://github.com/remram44/taguette/commit/67de2d2612e7e2572c61cd9627f89c2bfd0f2a36"
},
{
"type": "PACKAGE",
"url": "https://github.com/remram44/taguette"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N",
"type": "CVSS_V3"
}
],
"summary": "Open Redirect Vulnerability in Taguette"
}
Sightings
| Author | Source | Type | Date |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
- Confirmed: The vulnerability is confirmed from an analyst perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
- Patched: This vulnerability was successfully patched by the user reporting the sighting.
- Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
- Not confirmed: The user expresses doubt about the veracity of the vulnerability.
- Not patched: This vulnerability was not successfully patched by the user reporting the sighting.