GHSA-gxjj-f44v-qm94

Suggest an improvement
Source
https://github.com/advisories/GHSA-gxjj-f44v-qm94
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2021/12/GHSA-gxjj-f44v-qm94/GHSA-gxjj-f44v-qm94.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-gxjj-f44v-qm94
Withdrawn
2021-05-27T19:07:52Z
Published
2021-12-14T18:14:04Z
Modified
2024-12-02T05:38:56Z
Severity
  • 3.1 (Low) CVSS_V3 - CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:L/A:N CVSS Calculator
Summary
Open Redirect in Flask-Security-Too
Details

Withdrawn

Duplicate of GHSA-6qmf-fj6m-686c

Original description

Flask-Security-Too allows 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`.

Database specific
{
    "cwe_ids":  [
        "CWE-601"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2021-05-19T17:52:04Z",
    "nvd_published_at":  null,
    "severity":  "LOW"
}
References

Affected packages

PyPI / flask-security-too

Package

Name
flask-security-too
View open source insights on deps.dev
Purl
pkg:pypi/flask-security-too

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Last Affected
4.0.1

Affected versions

3.*
3.0.1rc1
3.0.1rc2
3.0.1rc3
3.0.1
3.0.2
3.1.0rc1
3.2.0rc1
3.2.0rc3
3.2.0rc4
3.2.0
3.3.0rc1
3.3.0rc2
3.3.0rc3
3.3.0
3.3.1
3.3.2
3.3.3
3.4.0
3.4.1
3.4.2
3.4.3
3.4.4
3.4.5
4.*
4.0.0rc1
4.0.0rc2
4.0.0
4.0.1

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2021/12/GHSA-gxjj-f44v-qm94/GHSA-gxjj-f44v-qm94.json"