CVE-2021-32618 json
Open Redirect Vulnerability
published 2021-05-17 5 y ago modified 2026-06-17 4 mo ago also GHSA-6qmf-fj6m-686c , PYSEC-2021-123 , EUVD-2021-0086
- cvss
- 3.1
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 2.8%
- EPSS 2.8% chance of exploitation in 30 days, percentile 86%
- public exploits
- 0
- none known, plus a Nuclei check
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`.
Patch / fix
- pypi flask-security-too 4.1.0
- python-flask-security-too Arch Linux 4.1.0-1
arch linux advisories AVG-1965
Exploit prediction
2.84% chance of exploitation in the next 30 days, higher than 86% of all scored CVEs (FIRST EPSS, 2026-11-08).
Exploits and checks
- Nuclei template Python Flask-Security - Open Redirect nuclei detection template
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:L/A:N |
| NVD | 3.1 | 6.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| NVD | 2.0 | 5.8 | AV:N/AC:M/Au:N/C:P/I:P/A:N |
| GitHub | 3.1 | 3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:L/A:N |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| pypi | flask-security-too | <4.1.0 |
4.1.0 |
Affected products
- Flask-Middleware flask-security
Classification
- Weakness
-
- CWE-601 URL Redirection to Untrusted Site
References
-
github.com
/Flask-Middleware/flask-security/commit/e39bb04615050448c1b8ba4caa7dacc0edd3e405
web
-
web.archive.org
/web/20220410062740/https://github.com/Flask-Middleware/flask-security/pull/489
web
-
github.com
/Flask-Middleware/flask-security/security/advisories/GHSA-6qmf-fj6m-686c
third-party-advisory, advisory
-
github.com
/Flask-Middleware/flask-security/issues/486
third-party-advisory, report
-
nvd.nist.gov
/vuln/detail/CVE-2021-32618
advisory
-
github.com
/Flask-Middleware/flask-security
package
-
github.com
/pypa/advisory-database/tree/main/vulns/flask-security-too/PYSEC-2021-123.yaml
web
-
web.archive.org
/web/20210517211717/https://github.com/Flask-Middleware/flask-security/issues/486
web
-
web.archive.org
/web/20211207121851/https://github.com/Flask-Middleware/flask-security/security/advisories/GHSA-6qmf-fj6m-686c
web
Sources
- CVE List CVE-2021-32618
- GitHub Advisory GHSA-6qmf-fj6m-686c
- NVD CVE-2021-32618
- OSV PYSEC-2021-123
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.