CVE-2021-21241 json
CSRF can expose users authentication token in Flask-Security-Too
published 2021-01-11 5 y ago modified 2026-06-17 4 mo ago also GHSA-hh7m-rx4f-4vpv , PYSEC-2021-91 , EUVD-2021-0087
- cvss
- 7.4
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.9%
- EPSS 0.9% chance of exploitation in 30 days, percentile 60%
- public exploits
- 0
- none known
Summary
The Python "Flask-Security-Too" package is used for adding security features to your Flask application. It is an is a independently maintained version of Flask-Security based on the 3.0.0 version of Flask-Security. In Flask-Security-Too from version 3.3.0 and before version 3.4.5, the /login and /change endpoints can return the authenticated user's authentication token in response to a GET request. Since GET requests aren't protected with a CSRF token, this could lead to a malicious 3rd party site acquiring the authentication token. Version 3.4.5 and version 4.0.0 are patched. As a workaround, if you aren't using authentication tokens - you can set the SECURITY_TOKEN_MAX_AGE to "0" (seconds) which should make the token unusable.
Patch / fix
- pypi flask-security-too 3.4.5
- flask-security-too_project flask-security-too 3.4.5
- flask-security Debian 14, Debian 13, Debian 12 4.0.0-1
debian advisories DEBIAN-CVE-2021-21241
- python-Flask-Security-Too SLES for SAP 15 SP2, SLES 15 SP2-LTSS, SLES 15 SP2-BCL +10 more 3.4.2-150200.3.3.1
suse advisories SUSE-SU-2022:3093-1
- python-Flask-Security openSUSE Tumbleweed 5.5.2-1.1
opensuse advisories openSUSE-SU-2024:14555-1
- python-flask-security-too Arch Linux 4.0.1-1
arch linux advisories AVG-1434
- github.com/Flask-Middleware/flask-security@61d3131 commit
- github.com/Flask-Middleware/flask-security@6d50ee9 commit
- web.archive.org/web/20210118165958/https://github.com/Flask-Middleware/fla… commit
- web.archive.org/web/20210118170445/https://github.com/Flask-Middleware/fla… commit
- github.com/Flask-Middleware/flask-security#422 pull request
- web.archive.org/web/20211207005640/https://github.com/Flask-Middleware/fla… pull request
- github.com/Flask-Middleware/flask-security/releases/tag/3.4.5 release
- web.archive.org/web/20210118165844/https://github.com/Flask-Middleware/fla… release
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2021-21241 updated cvss 7.4
python-flask-security: unprotected GET requests could lead to malicious party obtaining the authentication token
-
Red Hat All currently supported Red Hat productsnot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
Exploit prediction
0.93% chance of exploitation in the next 30 days, higher than 60% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 7.4 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N |
| NVD | 3.1 | 7.4 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N |
| NVD | 2.0 | 4.3 | AV:N/AC:M/Au:N/C:P/I:N/A:N |
| GitHub | 3.1 | 7.4 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| pypi | flask-security-too | >=3.3.0, <3.4.5 |
3.4.5 |
Affected products
- Flask-Middleware flask-security-too
Classification
- Weakness
-
- CWE-352 Cross-Site Request Forgery
References
-
github.com
/Flask-Middleware/flask-security/pull/422
patch, third-party-advisory, web
-
github.com
/Flask-Middleware/flask-security/commit/61d313150b5f620d0b800896c4f2199005e84b1f
patch, third-party-advisory
-
github.com
/Flask-Middleware/flask-security/commit/6d50ee9169acf813257c37b75babe9c28e83542a
patch, third-party-advisory
-
web.archive.org
/web/20210118165958/https://github.com/Flask-Middleware/flask-security/commit/6d50ee9169acf813257c37b75babe9c2
web
-
web.archive.org
/web/20210118170445/https://github.com/Flask-Middleware/flask-security/commit/61d313150b5f620d0b800896c4f21990
web
-
web.archive.org
/web/20211207005640/https://github.com/Flask-Middleware/flask-security/pull/422
web
-
github.com
/Flask-Middleware/flask-security/security/advisories/GHSA-hh7m-rx4f-4vpv
third-party-advisory, advisory
-
github.com
/Flask-Middleware/flask-security/releases/tag/3.4.5
third-party-advisory, web
-
pypi.org
/project/Flask-Security-Too
web, product, third-party-advisory, package
-
nvd.nist.gov
/vuln/detail/CVE-2021-21241
advisory
-
github.com
/pypa/advisory-database/tree/main/vulns/flask-security-too/PYSEC-2021-91.yaml
web
-
web.archive.org
/web/20210118165844/https://github.com/Flask-Middleware/flask-security/releases/tag/3.4.5
web
-
web.archive.org
/web/20210118170502/https://github.com/Flask-Middleware/flask-security/security/advisories/GHSA-hh7m-rx4f-4vpv
web
Sources
- CVE List CVE-2021-21241
- GitHub Advisory GHSA-hh7m-rx4f-4vpv
- NVD CVE-2021-21241
- OSV PYSEC-2021-91
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.