CVE-2021-23385 Open Redirect

Medium 5.4 Published Updated

Attackers can redirect users to malicious sites via bypassed URL validation in Flask-Security when using non-default WSGI configurations.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2021-23385?

CVE-2021-23385 is a medium-severity vulnerability in Flask-Security, published on 2 Aug 2022. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

This affects all versions of package Flask-Security. 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 behaviour of Werkzeug is modified using 'autocorrect_location_header=False. **Note:** Flask-Security is not maintained anymore.

Weakness: CWE-601

Which versions are affected by CVE-2021-23385?

3 open source packages ship an affected version, including flask-security and Flask-Security. It affects 1 product.

PackageAffectedFixed in
flask-security PyPIAll versions to 3.0.0None
flask-security PyPIAll versions5.5.1
Flask-Security PyPIAll versions to 3.0.0None
Linux distribution packages (6)
python-Flask-Security-Too SUSE:Linux Enterprise Module for Basesystem 15 SP3All versions3.4.2-150200.3.6.1
python-Flask-Security-Too SUSE:Linux Enterprise Module for Basesystem 15 SP4All versions3.4.2-150200.3.6.1
python-Flask-Security openSUSE:Leap 15.3All versions3.0.0-150100.4.3.1
python-Flask-Security-Too openSUSE:Leap 15.3All versions3.4.2-150200.3.6.1
python-Flask-Security openSUSE:Leap 15.4All versions3.0.0-150100.4.3.1
python-Flask-Security-Too openSUSE:Leap 15.4All versions3.4.2-150200.3.6.1

Products include Flask-Security Project Flask-Security.

How do I fix CVE-2021-23385?

Upgrade flask-security to 5.5.1 or later.

Is CVE-2021-23385 being exploited?

There is no known exploitation of CVE-2021-23385 in the wild and no public exploit code.

Sources

Also known as DEBIAN-CVE-2021-23385, DLA-3545-1, GHSA-cg8c-gc2j-2wf7, MGASA-2023-0105, PYSEC-2026-809, SUSE-SU-2022:3834-1 and 3 more.

Is CVE-2021-23385 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free