{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2021-21241","id":"CVE-2021-21241","title":"CSRF can expose users authentication token in Flask-Security-Too","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","descriptionLong":"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.","published":"2021-01-11T20:35:16.000Z","updated":"2026-06-17T03:35:06.603Z","reserved":"2020-12-22T00:00:00.000Z","status":"Modified","rejected":false,"assigner":"GitHub_M","metric":{"version":"3.1","score":7.4,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N","rating":"high","source":"GitHub_M"},"metrics":[{"version":"4.0","score":null,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:N/VA:N/SC:H/SI:N/SA:N","rating":"high","source":"GitHub"},{"version":"3.1","score":7.4,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N","rating":"high","source":"GitHub_M"},{"version":"3.1","score":7.4,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N","rating":"high","source":"github.com"},{"version":"3.1","score":7.4,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N","rating":"high","source":"NVD"},{"version":"3.1","score":7.4,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N","rating":"high","source":"OSV"},{"version":"3.1","score":7.4,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N","rating":"high","source":"GitHub"},{"version":"2.0","score":4.3,"vector":"AV:N/AC:M/Au:N/C:P/I:N/A:N","rating":"medium","source":"NVD"}],"rating":"high","products":["Flask-Middleware flask-security-too"],"affectedProducts":[{"vendor":"Flask-Middleware","product":"flask-security-too","defaultStatus":null,"versions":[{"status":"affected","version":">= 3.3.0, < 3.4.5"}],"platforms":[]}],"packages":[{"ecosystem":"PyPI","name":"flask-security-too","purl":"pkg:pypi/flask-security-too","ranges":[">=3.3.0 <3.4.5"],"fixed":["3.4.5"],"advisory":"GHSA-hh7m-rx4f-4vpv"}],"cwes":["CWE-352"],"aliases":["GHSA-hh7m-rx4f-4vpv","PYSEC-2021-91"],"references":[{"url":"https://github.com/Flask-Middleware/flask-security/security/advisories/GHSA-hh7m-rx4f-4vpv","tags":["x_refsource_CONFIRM","x_transferred","Third Party Advisory","advisory"]},{"url":"https://github.com/Flask-Middleware/flask-security/pull/422","tags":["x_refsource_MISC","x_transferred","Patch","Third Party Advisory","fix","web"]},{"url":"https://github.com/Flask-Middleware/flask-security/commit/61d313150b5f620d0b800896c4f2199005e84b1f","tags":["x_refsource_MISC","x_transferred","Patch","Third Party Advisory","fix"]},{"url":"https://github.com/Flask-Middleware/flask-security/commit/6d50ee9169acf813257c37b75babe9c28e83542a","tags":["x_refsource_MISC","x_transferred","Patch","Third Party Advisory","fix"]},{"url":"https://github.com/Flask-Middleware/flask-security/releases/tag/3.4.5","tags":["x_refsource_MISC","x_transferred","Third Party Advisory","advisory","web"]},{"url":"https://pypi.org/project/Flask-Security-Too","tags":["x_refsource_MISC","x_transferred","Product","Third Party Advisory","package","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-21241","tags":["advisory"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/flask-security-too/PYSEC-2021-91.yaml","tags":["web"]},{"url":"https://web.archive.org/web/20210118165844/https://github.com/Flask-Middleware/flask-security/releases/tag/3.4.5","tags":["web"]},{"url":"https://web.archive.org/web/20210118165958/https://github.com/Flask-Middleware/flask-security/commit/6d50ee9169acf813257c37b75babe9c28e83542a","tags":["web"]},{"url":"https://web.archive.org/web/20210118170445/https://github.com/Flask-Middleware/flask-security/commit/61d313150b5f620d0b800896c4f2199005e84b1f","tags":["web"]},{"url":"https://web.archive.org/web/20210118170502/https://github.com/Flask-Middleware/flask-security/security/advisories/GHSA-hh7m-rx4f-4vpv","tags":["web"]},{"url":"https://web.archive.org/web/20211207005640/https://github.com/Flask-Middleware/flask-security/pull/422","tags":["web"]}],"patchReferenced":true,"fixAvailable":true,"exploitReferenced":false,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":null,"epss":0.00928,"epssPercentile":0.61282,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2021-21241","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-21241","ok":true,"note":"Modified"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2021-21241","ok":true,"note":"1 package"},{"name":"GitHub Advisory","url":"https://github.com/advisories/GHSA-hh7m-rx4f-4vpv","ok":true,"note":"GHSA-hh7m-rx4f-4vpv"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2021-21241","ok":true,"note":"scored 2026-11-19"}],"aiTitle":false,"tech":["flask"],"critical":[],"attention":null}