{"id":"CVE-2021-21241","state":"PUBLISHED","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. 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.","publishedAt":"2021-01-11T20:35:16.000Z","updatedAt":"2024-08-03T18:09:15.009Z","severity":{"score":7.4,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N","source":"GitHub_M"},"assigner":"GitHub_M","products":["Flask-Middleware flask-security-too"],"affected":[{"vendor":"Flask-Middleware","product":"flask-security-too","versions":[{"version":">= 3.3.0, < 3.4.5","status":"affected"}]}],"references":["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/61d313150b5f620d0b800896c4f2199005e84b1f","https://github.com/Flask-Middleware/flask-security/commit/6d50ee9169acf813257c37b75babe9c28e83542a","https://github.com/Flask-Middleware/flask-security/releases/tag/3.4.5","https://pypi.org/project/Flask-Security-Too"],"weaknesses":["CWE-352"],"ingestedAt":"2026-10-29T19:47:59.168Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2021/21xxx/CVE-2021-21241.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.1","cveMetadata":{"cveId":"CVE-2021-21241","state":"PUBLISHED","datePublished":"2021-01-11T20:35:16.000Z","dateUpdated":"2024-08-03T18:09:15.009Z","assignerShortName":"GitHub_M","assignerOrgId":"a0819718-46f1-4df5-94e2-005712e83aaa","dateReserved":"2020-12-22T00:00:00.000Z"},"containers":{"cna":{"title":"CSRF can expose users authentication token in Flask-Security-Too","descriptions":[{"lang":"en","value":"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."}],"affected":[{"vendor":"Flask-Middleware","product":"flask-security-too","versions":[{"version":">= 3.3.0, < 3.4.5","status":"affected"}]}],"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"]}],"metrics":[{"cvssV3_1":{"attackComplexity":"LOW","attackVector":"NETWORK","availabilityImpact":"NONE","baseScore":7.4,"baseSeverity":"HIGH","confidentialityImpact":"HIGH","integrityImpact":"NONE","privilegesRequired":"NONE","scope":"CHANGED","userInteraction":"REQUIRED","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N","version":"3.1"}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-352","description":"CWE-352: Cross-Site Request Forgery (CSRF)","lang":"en","type":"CWE"}]}],"providerMetadata":{"shortName":"GitHub_M","dateUpdated":"2021-01-11T20:35:16.000Z","orgId":"a0819718-46f1-4df5-94e2-005712e83aaa"},"source":{"advisory":"GHSA-hh7m-rx4f-4vpv","discovery":"UNKNOWN"},"x_legacyV4Record":{"CVE_data_meta":{"ASSIGNER":"security-advisories@github.com","ID":"CVE-2021-21241","STATE":"PUBLIC","TITLE":"CSRF can expose users authentication token in Flask-Security-Too"},"affects":{"vendor":{"vendor_data":[{"product":{"product_data":[{"product_name":"flask-security-too","version":{"version_data":[{"version_value":">= 3.3.0, < 3.4.5"}]}}]},"vendor_name":"Flask-Middleware"}]}},"data_format":"MITRE","data_type":"CVE","data_version":"4.0","description":{"description_data":[{"lang":"eng","value":"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."}]},"impact":{"cvss":{"attackComplexity":"LOW","attackVector":"NETWORK","availabilityImpact":"NONE","baseScore":7.4,"baseSeverity":"HIGH","confidentialityImpact":"HIGH","integrityImpact":"NONE","privilegesRequired":"NONE","scope":"CHANGED","userInteraction":"REQUIRED","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N","version":"3.1"}},"problemtype":{"problemtype_data":[{"description":[{"lang":"eng","value":"CWE-352: Cross-Site Request Forgery (CSRF)"}]}]},"references":{"reference_data":[{"name":"https://github.com/Flask-Middleware/flask-security/security/advisories/GHSA-hh7m-rx4f-4vpv","refsource":"CONFIRM","url":"https://github.com/Flask-Middleware/flask-security/security/advisories/GHSA-hh7m-rx4f-4vpv"},{"name":"https://github.com/Flask-Middleware/flask-security/pull/422","refsource":"MISC","url":"https://github.com/Flask-Middleware/flask-security/pull/422"},{"name":"https://github.com/Flask-Middleware/flask-security/commit/61d313150b5f620d0b800896c4f2199005e84b1f","refsource":"MISC","url":"https://github.com/Flask-Middleware/flask-security/commit/61d313150b5f620d0b800896c4f2199005e84b1f"},{"name":"https://github.com/Flask-Middleware/flask-security/commit/6d50ee9169acf813257c37b75babe9c28e83542a","refsource":"MISC","url":"https://github.com/Flask-Middleware/flask-security/commit/6d50ee9169acf813257c37b75babe9c28e83542a"},{"name":"https://github.com/Flask-Middleware/flask-security/releases/tag/3.4.5","refsource":"MISC","url":"https://github.com/Flask-Middleware/flask-security/releases/tag/3.4.5"},{"name":"https://pypi.org/project/Flask-Security-Too","refsource":"MISC","url":"https://pypi.org/project/Flask-Security-Too"}]},"source":{"advisory":"GHSA-hh7m-rx4f-4vpv","discovery":"UNKNOWN"}}},"adp":[{"title":"CVE Program Container","references":[{"url":"https://github.com/Flask-Middleware/flask-security/security/advisories/GHSA-hh7m-rx4f-4vpv","tags":["x_refsource_CONFIRM","x_transferred"]},{"url":"https://github.com/Flask-Middleware/flask-security/pull/422","tags":["x_refsource_MISC","x_transferred"]},{"url":"https://github.com/Flask-Middleware/flask-security/commit/61d313150b5f620d0b800896c4f2199005e84b1f","tags":["x_refsource_MISC","x_transferred"]},{"url":"https://github.com/Flask-Middleware/flask-security/commit/6d50ee9169acf813257c37b75babe9c28e83542a","tags":["x_refsource_MISC","x_transferred"]},{"url":"https://github.com/Flask-Middleware/flask-security/releases/tag/3.4.5","tags":["x_refsource_MISC","x_transferred"]},{"url":"https://pypi.org/project/Flask-Security-Too","tags":["x_refsource_MISC","x_transferred"]}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2024-08-03T18:09:15.009Z"}}]}}}