CSRF can expose users authentication token
Issue
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.
Patches
Version 3.4.5 and soon to be released 4.0.0 are patched.
Workarounds
If you aren't using authentication tokens - you can set the SECURITY_TOKEN_MAX_AGE to "0" (seconds) which should make the token unusable.
References
None
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| Python (PyPI) | flask-security-too | >= 3.3.0, < 3.4.5 | 3.4.5 |
References
- https://github.com/Flask-Middleware/flask-security/releases/tag/3.4.5
- https://pypi.org/project/Flask-Security-Too
- https://github.com/Flask-Middleware/flask-security/commit/61d313150b5f620d0b800896c4f2199005e84b1f
- https://github.com/Flask-Middleware/flask-security/security/advisories/GHSA-hh7m-rx4f-4vpv
- https://github.com/Flask-Middleware/flask-security/pull/422
- https://github.com/Flask-Middleware/flask-security/commit/6d50ee9169acf813257c37b75babe9c28e83542a
- https://nvd.nist.gov/vuln/detail/CVE-2021-21241
- 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
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N- Weakness (CWE)
CWE-352- Platform
- Python (PyPI)
- Package
flask-security-too- Disclosed
- 11.01.2021
- Updated
- 11.10.2026 12:19
Sources and licenses
OSV / GitHub Advisory Database - PYSEC-2021-91 - PyPA Advisory Database; CC BY 4.0
OSV / GitHub Advisory Database - GHSA-hh7m-rx4f-4vpv - CC BY 4.0
Vulnerability history: flask-security-too
All published vulnerabilities of this package (Python (PyPI)), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 6
- First → latest
- 01.2021 07.2026
- Without a fix
- 1
- Exploited in attacks
- 0
Severity breakdown
- High 1
- Medium 3
- Low 2
Disclosures per year
- 2021: 3
- 2022: 0
- 2023: 1
- 2024: 0
- 2025: 0
- 2026: 2
-
CSRF can expose users authentication token this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.