CSRF can expose users authentication token in Flask-Security-Too
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- Tampering
- Confidentiality · integrity · availability
- High · None · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-352.
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.
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-too | 3.3.0 to before 3.4.5 | 3.4.5 | Patch available | CNA |
| — | Flask-Security-Too (PyPI) | 3.3.0 to before 3.4.5 | 3.4.5 | Patch available | GHSA-hh7m-rx4f-4vpv |
- flask-security-too VendorFlask-Middleware Affected 3.3.0 to before 3.4.5 Fixed in 3.4.5 Patch available CNA
- Flask-Security-Too (PyPI) Vendor— Affected 3.3.0 to before 3.4.5 Fixed in 3.4.5 Patch available GHSA-hh7m-rx4f-4vpv
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:flask-security-too_project:flask-security-too:*:*:*:*:*:*:*:* | 3.3.0 to before 3.4.5 | Vulnerable | Flask-security-too Project |
- cpe:2.3:a:flask-security-too_project:flask-security-too:*:*:*:*:*:*:*:* Versions 3.3.0 to before 3.4.5 Vulnerable ·Flask-security-too Project
Remediation
- Fix · CNA flask-security-too (Flask-Middleware) Fixed in 3.4.5
- Fix · GHSA-hh7m-rx4f-4vpv Flask-Security-Too (PyPI) Fixed in 3.4.5 Advisory →
Vendor assessments
Timeline
- 2026-10-02 Threatist record created from CVE-2021-21241
- 2026-10-03 Alias added: GHSA-hh7m-rx4f-4vpv
References
Patch 3
Advisory 4
Other 6
- https://github.com/pypa/advisory-database/tree/main/vulns/flask-security-too/PYSEC-2021-91.yaml
- https://web.archive.org/web/20210118165844/https://github.com/Flask-Middleware/flask-security/releases/tag/3.4.5
- https://web.archive.org/web/20210118165958/https://github.com/Flask-Middleware/flask-security/commit/6d50ee9169acf813257c37b75babe9c28e83542a
- https://web.archive.org/web/20210118170445/https://github.com/Flask-Middleware/flask-security/commit/61d313150b5f620d0b800896c4f2199005e84b1f
- https://web.archive.org/web/20210118170502/https://github.com/Flask-Middleware/flask-security/security/advisories/GHSA-hh7m-rx4f-4vpv
- https://web.archive.org/web/20211207005640/https://github.com/Flask-Middleware/flask-security/pull/422
More Flask-security-too Project Flask-security-too vulnerabilities
- TI-2023-27010 An open redirect vulnerability in the python package Flask-Security-Too <=5.3.2 allows… CVSS 3.1MEDIUM 6.1
Sources
- CVE-2021-21241 · CVE Program
- CVE-2021-21241 · NVD
- FIRST EPSS
- GHSA-hh7m-rx4f-4vpv · GitHub Advisory Database · CC BY 4.0
- CVE-2021-21241 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences