Open redirect in Flask-Middleware flask-security
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- Spoofing
- Confidentiality · integrity · availability
- Low · Low · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · NVD. Fix status from CNA and GitHub. Impact type from CWE-601.
Summary
The Python "Flask-Security-Too" package is used for adding security features to your Flask application. It is an is an independently maintained version of Flask-Security based on the 3.0.0 version of Flask-Security. All versions of Flask-Security-Too allow redirects after many successful views (e.g. /login) by honoring the ?next query param. There is code in FS to validate that the url specified in the next parameter is either relative OR has the same netloc (network location) as the requesting URL. This check utilizes Pythons urlsplit library. However many browsers are very lenient on the kind of URL they accept and 'fill in the blanks' when presented with a possibly incomplete URL. As a concrete example - setting http://login?next=\\\github.com will pass FS's relative URL check however many browsers will gladly convert this to http://github.com. Thus an attacker could send such a link to an unwitting user, using a legitimate site and have it redirect to whatever site they want. This is considered a low severity due to the fact that if Werkzeug is used (which is very common with Flask applications) as the WSGI layer, it by default ALWAYS ensures that the Location header is absolute - thus making this attack vector mute. It is possible for application writers to modify this default behavior by setting the 'autocorrect_location_header=False`.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| Flask-Middleware | flask-security | up to 4.0.1 | — | No fix listed | CNA |
| — | Flask-Security-Too (PyPI) | before 4.1.0 | 4.1.0 | Patch available | GHSA-6qmf-fj6m-686c |
- flask-security VendorFlask-Middleware Affected up to 4.0.1 Fixed in — No fix listed CNA
- Flask-Security-Too (PyPI) Vendor— Affected before 4.1.0 Fixed in 4.1.0 Patch available GHSA-6qmf-fj6m-686c
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:flask-security_project:flask-security:*:*:*:*:*:*:*:* | all versions | Vulnerable | Flask-security Project |
- cpe:2.3:a:flask-security_project:flask-security:*:*:*:*:*:*:*:* Versions all versions Vulnerable ·Flask-security Project
Remediation
- Fix · GHSA-6qmf-fj6m-686c Flask-Security-Too (PyPI) Fixed in 4.1.0 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2021-32618
- 2026-10-03 Alias added: GHSA-6qmf-fj6m-686c
References
Advisory 3
Other 6
- https://github.com/Flask-Middleware/flask-security/commit/e39bb04615050448c1b8ba4caa7dacc0edd3e405
- https://github.com/Flask-Middleware/flask-security
- https://github.com/pypa/advisory-database/tree/main/vulns/flask-security-too/PYSEC-2021-123.yaml
- https://web.archive.org/web/20210517211717/https://github.com/Flask-Middleware/flask-security/issues/486
- https://web.archive.org/web/20211207121851/https://github.com/Flask-Middleware/flask-security/security/advisories/GHSA-6qmf-fj6m-686c
- https://web.archive.org/web/20220410062740/https://github.com/Flask-Middleware/flask-security/pull/489
More Flask-security Project Flask-security vulnerabilities
- TI-2021-06078 Open redirect in Flask-Security CVSS 3.1MEDIUM 6.1
Sources
- CVE-2021-32618 · CVE Program
- CVE-2021-32618 · NVD
- FIRST EPSS
- GHSA-6qmf-fj6m-686c · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences