# CVE-2021-32618: Open Redirect in Flask-Security-Too

Source: https://junglewise.ai/threats/cve-2021-32618-open-redirect-in-flask-security-too  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2021-05-17  
License: CC BY 4.0 with a link back

CVE-2021-32618 · Severity: low · CVSS 3.1 · Published 2021-05-17

The Python "Flask-Security-Too" package is used for adding security features to your Flask application. It is an is an independently maintained version of Flask-Security based on the 3.0.0 version of Flask-Security. All versions of Flask-Security-Too allow redirects after many successful views (e.g. /login) by honoring the ?next query param. There is code in FS to validate that the url specified in the next parameter is either relative OR has the same netloc (network location) as the requesting URL. This check utilizes Pythons urlsplit library. However many browsers are very lenient on the kind of URL they accept and 'fill in the blanks' when presented with a possibly incomplete URL. As a concrete example - setting http://login?next=\\\github.com will pass FS's relative URL check however many browsers will gladly convert this to http://github.com. Thus an attacker could send such a link to an unwitting user, using a legitimate site and have it redirect to whatever site they want. This is considered a low severity due to the fact that if Werkzeug is used (which is very common with Flask applications) as the WSGI layer, it by default ALWAYS ensures that the Location header is absolute - thus making this attack vector mute. It is possible for application writers to modify this default behavior by setting the `autocorrect_location_header=False`.

Technologies: [Flask-Security-Too (PyPI)](https://junglewise.ai/threats/technologies/flask-security-too). Vendors: [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2021-32618 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2021-32618 being exploited in the wild.

**How severe is CVE-2021-32618?** Low severity, with a CVSS score of 3.1, published 17 May 2021.

**Which products and versions are affected?** Flask-Security-Too (PyPI) ECOSYSTEM:introduced=0,fixed=4.1.0.

**Is there a fix for CVE-2021-32618?** Yes. Flask-Security-Too (PyPI): upgrade to 4.1.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**Am I affected by CVE-2021-32618?** Check whether you run Flask-Security-Too (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- Flask-Security-Too (PyPI): upgrade to 4.1.0 or later

  ```sh
  pip install "Flask-Security-Too>=4.1.0"
  ```


## Affected products

- Flask-Security-Too (PyPI) ECOSYSTEM:introduced=0,fixed=4.1.0

## Identifiers

- CVE-2021-32618
- GHSA-6qmf-fj6m-686c
- PYSEC-2021-123

## Related threats

- [Pallets-Eco Flask-Security-Too OAuth reauthentication freshness bypass](https://junglewise.ai/threats/cve-2026-46715-pallets-eco-flask-security-too-oauth-reauthentication-freshness)
- [Flask-Security-Too WebAuthn reauthentication freshness bypass](https://junglewise.ai/threats/flask-security-too-webauthn-reauthentication-freshness-bypass-1d81eff2)
- [Open redirect vulnerability in Flask-Security-Too](https://junglewise.ai/threats/cve-2023-49438-open-redirect-vulnerability-in-flask-security-too)
- [Open Redirect in Flask-Security-Too](https://junglewise.ai/threats/open-redirect-in-flask-security-too-42401b09)
- [CSRF Vuln can expose user's QRcode](https://junglewise.ai/threats/csrf-vuln-can-expose-user-s-qrcode-5d832024)
