{"id":"CVE-2021-21241","published":"2021-01-11T20:35:16Z","modified":"2024-08-03T18:09:15Z","title":"CSRF can expose users authentication token in Flask-Security-Too","vendor":"Flask-Middleware","product":"flask-security-too","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.4,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00928,"percentile":0.61401,"provenance":"source"},"cwes":[{"id":"CWE-352","name":"Cross-Site Request Forgery"}],"references":[{"url":"https://github.com/Flask-Middleware/flask-security/security/advisories/GHSA-hh7m-rx4f-4vpv","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/Flask-Middleware/flask-security/pull/422","tags":["x_refsource_MISC"]},{"url":"https://github.com/Flask-Middleware/flask-security/commit/61d313150b5f620d0b800896c4f2199005e84b1f","tags":["x_refsource_MISC"]},{"url":"https://github.com/Flask-Middleware/flask-security/commit/6d50ee9169acf813257c37b75babe9c28e83542a","tags":["x_refsource_MISC"]},{"url":"https://github.com/Flask-Middleware/flask-security/releases/tag/3.4.5","tags":["x_refsource_MISC"]},{"url":"https://pypi.org/project/Flask-Security-Too","tags":["x_refsource_MISC"]}],"priority":{"score":17.5,"factors":[{"name":"EPSS percentile","points":12.28},{"name":"CVSS severity","points":5.18}]},"vendorSlug":"flask-middleware","affectedVersions":[{"vendor":"Flask-Middleware","product":"flask-security-too","versions":[">= 3.3.0, < 3.4.5"]}],"affected":[{"ecosystem":"PyPI","package":"Flask-Security-Too","vulnerableRanges":[">=3.3.0, <3.4.5"],"patched":["3.4.5"],"from":["GHSA-hh7m-rx4f-4vpv","PYSEC-2021-91"],"provenance":"source"}],"summary":{"text":"The flaw is in the /login and /change endpoints of the flask-security-too package, a Python library for adding security features to Flask applications, where a GET request can return the authenticated user's authentication token. An attacker can get that token by luring a user to a malicious third-party site, which triggers a cross-site request against the vulnerable endpoint, and no authentication is needed but user interaction is required.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T20:42:47Z"},"euvd":{"id":"EUVD-2021-0087","exploited":false,"provenance":"source"}}