PyPI: flask-security
CVE-2021-23385
Safety vulnerability ID: SFTY-20220802-14391
Safety legacy ID: pyup.io-44501
All versions of flask-security are affected by CVE-2021-23385, an open redirect vulnerability: When using the get_post_logout_redirect and get_post_login_redirect functions, it is possible to bypass URL validation and redirect a user to an arbitrary URL by providing multiple back slashes such as \\\evil.com/path. This vulnerability is only exploitable if an alternative WSGI server other than Werkzeug is used, or the default behavior of Werkzeug is modified using 'autocorrect_location_header=False'. Note: Flask-Security is not maintained anymore.
Overview
Flask-Security vulnerable to Open Redirect
Advisory
All versions of flask-security are affected by CVE-2021-23385, an open redirect vulnerability: When using the get_post_logout_redirect and get_post_login_redirect functions, it is possible to bypass URL validation and redirect a user to an arbitrary URL by providing multiple back slashes such as \\\evil.com/path. This vulnerability is only exploitable if an alternative WSGI server other than Werkzeug is used, or the default behavior of Werkzeug is modified using 'autocorrect_location_header=False'. Note: Flask-Security is not maintained anymore.
How to Fix
We recommend updating flask-security to the latest non-vulnerable version.
Mitigation and Workarounds
---
Vulnerable Functions
Functions linked to known vulnerabilities.
References
- https://getsafety.com/vulnerabilities/SFTY-20220802-14391/CVE-2021-23385
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-23385
- https://github.com/mattupstate/flask-security
- https://lists.debian.org/debian-lts-announce/2023/08/msg00034.html
- https://security.snyk.io/vuln/SNYK-PYTHON-FLASKSECURITY-1293234
- https://snyk.io/blog/url-confusion-vulnerabilities/
- https://nvd.nist.gov/vuln/detail/CVE-2021-23385
- https://github.com/mattupstate/flask-security
- https://security.snyk.io/vuln/SNYK-PYTHON-FLASKSECURITY-1293234
- https://snyk.io/blog/url-confusion-vulnerabilities/
- https://github.com/advisories/GHSA-cg8c-gc2j-2wf7
Verified by Safety
Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.
Learn more
