# CVE-2021-21241: CSRF can expose users authentication token

Source: https://junglewise.ai/threats/cve-2021-21241-csrf-can-expose-users-authentication-token  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2021-01-11  
License: CC BY 4.0 with a link back

CVE-2021-21241 · Severity: low · CVSS 3.1 · Published 2021-01-11

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.

Technologies: [Flask-Security-Too (PyPI)](https://junglewise.ai/threats/technologies/flask-security-too). Vendors: [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2021-21241 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2021-21241 being exploited in the wild.

**How severe is CVE-2021-21241?** Low severity, with a CVSS score of 3.1, published 11 January 2021.

**Which products and versions are affected?** Flask-Security-Too (PyPI) ECOSYSTEM:introduced=3.3.0,fixed=3.4.5, GIT:introduced=0,fixed=61d313150b5f620d0b800896c4f2199005e84b1f,fixed=6d50ee9169acf813257c37b75babe9c28e83542a|ECOSYSTEM:introduced=3.3.0,fixed=3.4.5.

**Is there a fix for CVE-2021-21241?** Yes. Flask-Security-Too (PyPI): upgrade to 3.4.5 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**Am I affected by CVE-2021-21241?** Check whether you run Flask-Security-Too (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- Flask-Security-Too (PyPI): upgrade to 3.4.5 or later

  ```sh
  pip install "Flask-Security-Too>=3.4.5"
  ```


## Affected products

- Flask-Security-Too (PyPI) ECOSYSTEM:introduced=3.3.0,fixed=3.4.5, GIT:introduced=0,fixed=61d313150b5f620d0b800896c4f2199005e84b1f,fixed=6d50ee9169acf813257c37b75babe9c28e83542a|ECOSYSTEM:introduced=3.3.0,fixed=3.4.5

## Identifiers

- CVE-2021-21241
- GHSA-hh7m-rx4f-4vpv
- PYSEC-2021-91

## Related threats

- [Pallets-Eco Flask-Security-Too OAuth reauthentication freshness bypass](https://junglewise.ai/threats/cve-2026-46715-pallets-eco-flask-security-too-oauth-reauthentication-freshness)
- [Flask-Security-Too WebAuthn reauthentication freshness bypass](https://junglewise.ai/threats/flask-security-too-webauthn-reauthentication-freshness-bypass-1d81eff2)
- [Open redirect vulnerability in Flask-Security-Too](https://junglewise.ai/threats/cve-2023-49438-open-redirect-vulnerability-in-flask-security-too)
- [Open Redirect in Flask-Security-Too](https://junglewise.ai/threats/open-redirect-in-flask-security-too-42401b09)
- [Open Redirect in Flask-Security-Too](https://junglewise.ai/threats/cve-2021-32618-open-redirect-in-flask-security-too)
