CVE-2021-21241
CSRF can expose users authentication token in Flask-Security-Too
- Published
- Updated
- Reserved
- Assigned by
- GitHub_M
Description
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.
Timeline
ID reserved
By GitHub_M
- 20 days later
· 20 days later
Published
- 4 years later
· 4 years later
Record updated
Changes after publication (a new score, a public exploit, EPSS crossing 1, 10 or 50 %, leaving KEV) are kept since November 2026; earlier ones are not known.
Scores
| Scored by | CVSS | Score | Vector |
|---|---|---|---|
| GitHub_MCNA (assigner) | 3.1 | High7.4 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N |
| NVDNVD · Modified | 3.1 | High7.4 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N |
- EPSS (exploitation in 30 days)
- 0.93% · top 39% of all CVEs (7 Nov 2026)
The list uses the assigner's score when there is one, then CISA's, then NVD's: High 7.4.
Weakness
Affected products
Flask-Middleware · flask-security-too
- affected >= 3.3.0, < 3.4.5
Affected packages
From reviewed advisories of the GitHub Advisory Database.
- PyPIFlask-Security-TooGHSA-hh7m-rx4f-4vpv (opens in a new tab)
References (6)
- https://github.com/Flask-Middleware/flask-security/security/advisories/GHSA-hh7m-rx4f-4vpv (opens in a new tab)x_refsource_CONFIRMx_transferred
- https://github.com/Flask-Middleware/flask-security/pull/422 (opens in a new tab)x_refsource_MISCx_transferred
- https://github.com/Flask-Middleware/flask-security/commit/61d313150b5f620d0b800896c4f2199005e84b1f (opens in a new tab)x_refsource_MISCx_transferred
- https://github.com/Flask-Middleware/flask-security/commit/6d50ee9169acf813257c37b75babe9c28e83542a (opens in a new tab)x_refsource_MISCx_transferred
- https://github.com/Flask-Middleware/flask-security/releases/tag/3.4.5 (opens in a new tab)x_refsource_MISCx_transferred
- https://pypi.org/project/Flask-Security-Too (opens in a new tab)x_refsource_MISCx_transferred
Sources
The same CVE in the primary databases and aggregators, to check against.
- CVE.org record (opens in a new tab)
- CVE List JSON (GitHub) (opens in a new tab)
- NVD (opens in a new tab)
- FIRST EPSS (opens in a new tab)
- OSV.dev (opens in a new tab)
- GitHub Advisory GHSA-hh7m-rx4f-4vpv (opens in a new tab)
- CIRCL Vulnerability-Lookup (opens in a new tab)
Badge for a README or a ticket
[](https://trackcve.app/cve/CVE-2021-21241)Record last updated .