6.1
MEDIUM
CVE-2021-32618
Flask-Security-Too Relative URL Redirectattended Reflected File Include
Description

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`.

INFO

Published Date :

May 17, 2021, 6:15 p.m.

Last Modified :

May 26, 2021, 4:51 p.m.

Remotely Exploitable :

Yes !

Impact Score :

2.7

Exploitability Score :

2.8
Public PoC/Exploit Available at Github

CVE-2021-32618 has a 2 public PoC/Exploit available at Github. Go to the Public Exploits tab to see the list.

Affected Products

The following products are affected by CVE-2021-32618 vulnerability. Even if cvefeed.io is aware of the exact versions of the products that are affected, the information is not represented in the table below.

ID Vendor Product Action
1 Flask-security_project flask-security
References to Advisories, Solutions, and Tools

Here, you will find a curated list of external links that provide in-depth information, practical solutions, and valuable tools related to CVE-2021-32618.

URL Resource
https://github.com/Flask-Middleware/flask-security/issues/486 Third Party Advisory
https://github.com/Flask-Middleware/flask-security/security/advisories/GHSA-6qmf-fj6m-686c Third Party Advisory

We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).

CVE-2023-49438 - Open Redirect Vulnerability in Flask-Security-Too

Updated: 8 months, 4 weeks ago
5 stars 0 fork 0 watcher
Born at : Dec. 14, 2023, 11:58 p.m. This repo has been linked 2 different CVEs too.

essential templates for kenzer [DEPRECATED]

kenzer vulnerabilities kenzer-templates arpsyndicate

Python Shell Ruby

Updated: 1 month, 3 weeks ago
106 stars 32 fork 32 watcher
Born at : Sept. 18, 2020, 9:03 p.m. This repo has been linked 1653 different CVEs too.

Results are limited to the first 15 repositories due to potential performance issues.

The following list is the news that have been mention CVE-2021-32618 vulnerability anywhere in the article.

The following table lists the changes that have been made to the CVE-2021-32618 vulnerability over time.

Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.

  • CVE Modified by [email protected]

    May. 14, 2024

    Action Type Old Value New Value
  • Initial Analysis by [email protected]

    May. 26, 2021

    Action Type Old Value New Value
    Added CVSS V2 Metadata Victim must voluntarily interact with attack mechanism
    Added CVSS V2 NIST (AV:N/AC:M/Au:N/C:P/I:P/A:N)
    Added CVSS V3.1 NIST AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
    Changed Reference Type https://github.com/Flask-Middleware/flask-security/issues/486 No Types Assigned https://github.com/Flask-Middleware/flask-security/issues/486 Third Party Advisory
    Changed Reference Type https://github.com/Flask-Middleware/flask-security/security/advisories/GHSA-6qmf-fj6m-686c No Types Assigned https://github.com/Flask-Middleware/flask-security/security/advisories/GHSA-6qmf-fj6m-686c Third Party Advisory
    Added CPE Configuration OR *cpe:2.3:a:flask-security_project:flask-security:*:*:*:*:*:*:*:*
  • CVE Modified by [email protected]

    May. 17, 2021

    Action Type Old Value New Value
    Changed Description 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`. 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`.
EPSS is a daily estimate of the probability of exploitation activity being observed over the next 30 days. Following chart shows the EPSS score history of the vulnerability.
CWE - Common Weakness Enumeration

While CVE identifies specific instances of vulnerabilities, CWE categorizes the common flaws or weaknesses that can lead to vulnerabilities. CVE-2021-32618 is associated with the following CWEs:

Common Attack Pattern Enumeration and Classification (CAPEC)

Common Attack Pattern Enumeration and Classification (CAPEC) stores attack patterns, which are descriptions of the common attributes and approaches employed by adversaries to exploit the CVE-2021-32618 weaknesses.

Exploit Prediction

EPSS is a daily estimate of the probability of exploitation activity being observed over the next 30 days.

0.11 }} 0.01%

score

0.44703

percentile

CVSS31 - Vulnerability Scoring System
Attack Vector
Attack Complexity
Privileges Required
User Interaction
Scope
Confidentiality
Integrity
Availability