GHSA-GXJJ-F44V-QM94
Vulnerability from github – Published: 2021-12-14 18:14 – Updated: 2021-12-14 18:14Withdrawn
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`.
{
"affected": [
{
"package": {
"ecosystem": "PyPI",
"name": "Flask-Security-Too"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"last_affected": "4.0.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [
"CWE-601"
],
"github_reviewed": true,
"github_reviewed_at": "2021-05-19T17:52:04Z",
"nvd_published_at": null,
"severity": "LOW"
},
"details": "# Withdrawn\n\nDuplicate of GHSA-6qmf-fj6m-686c\n\n# Original description\n\nFlask-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.\n\nThis check utilizes Pythons urlsplit library. However many browsers are very lenient on the kind of URL they accept and \u0027fill in the blanks\u0027 when presented with a possibly incomplete URL. As a concrete example - setting http://login?next=\\\\\\github.com\nwill pass FS\u0027s 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.\n\nThis 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 \u0027autocorrect_location_header=False`.",
"id": "GHSA-gxjj-f44v-qm94",
"modified": "2021-12-14T18:14:54Z",
"published": "2021-12-14T18:14:04Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/Flask-Middleware/flask-security/security/advisories/GHSA-6qmf-fj6m-686c"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-32618"
},
{
"type": "WEB",
"url": "https://github.com/Flask-Middleware/flask-security/issues/486"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:L/A:N",
"type": "CVSS_V3"
}
],
"summary": "Open Redirect in Flask-Security-Too",
"withdrawn": "2021-05-27T19:07:52Z"
}
Sightings
| Author | Source | Type | Date |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.