{"answers":{"affected":"3 open source packages ship an affected version, including flask-security-too and Flask-Security-Too. It affects 1 product.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2021-32618 exists.","fix":"Upgrade flask-security-too to 4.1.0 or later.","what":"CVE-2021-32618 is a low-severity vulnerability in Flask-Middleware flask-security, published on 17 May 2021. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for CVE-2021-32618 and fix it if it is affected.\n\nWhat it is: CVE-2021-32618 is a low-severity vulnerability in Flask-Middleware flask-security, published on 17 May 2021. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2021-32618 exists.\n\nAffected packages and fixed versions:\n- flask-security-too (PyPI): affected all versions; fixed in 4.1.0\n- flask-security-too (PyPI): affected all versions; fixed in 4.1.0\n- Flask-Security-Too (PyPI): affected all versions; fixed in 4.1.0\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2021-32618/ (Markdown: https://insights.sbomify.com/CVE-2021-32618/index.md)","id":"CVE-2021-32618","markdown":"https://insights.sbomify.com/CVE-2021-32618/index.md","name":"CVE-2021-32618","record":{"aliases":["GHSA-6qmf-fj6m-686c","PYSEC-2021-123","UBUNTU-CVE-2021-32618"],"analysis":{"component_type":"library","fix_type":"patch","impacts":["security_bypass"],"network_reachable":"yes","non_default_config":true,"product_category":"Flask security library","requires_auth":"none","summary":"Attackers can redirect users to malicious sites via crafted next parameters if Werkzeug's default header correction is disabled.","user_interaction":"required","vuln_class":"open_redirect"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"flask-security","vendor":"flask-security_project"}],"cvss":{"score":3.1,"severity":"low","source":"cna","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:L/A:N","version":"3.1"},"cwes":[{"id":"CWE-601","name":"URL Redirection to Untrusted Site"}],"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`.","ecosystems":["PyPI"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":1,"refs":[{"date":null,"kind":"nuclei","ref":"http/cves/2021/CVE-2021-32618.yaml","stars":null,"title":"Python Flask-Security - Open Redirect"}],"tier":"weaponised"},"has_fix":true,"headline":"Open Redirect Vulnerability","id":"CVE-2021-32618","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"PyPI","product":null,"products":[],"type":"open_redirect","year":"2021"},"n_packages":3,"n_references":2,"next":{"headline":"Static imports inside dynamically imported modules do not adhere to permission checks","id":"CVE-2021-32619"},"packages":[{"ecosystem":"PyPI","fixed":["4.1.0"],"introduced":["0"],"last_affected":[],"package":"Flask-Security-Too","purl":null,"source":"GHSA-6qmf-fj6m-686c"},{"ecosystem":"PyPI","fixed":["4.1.0"],"introduced":["0"],"last_affected":[],"package":"flask-security-too","purl":"pkg:pypi/flask-security-too","source":"GHSA-6qmf-fj6m-686c"},{"ecosystem":"PyPI","fixed":["4.1.0"],"introduced":["0"],"last_affected":[],"package":"flask-security-too","purl":"pkg:pypi/flask-security-too","source":"PYSEC-2021-123"}],"prev":{"headline":"Denial of service in Exiv2","id":"CVE-2021-32617"},"products":["flask-security"],"published":"2021-05-17","related":[{"cvss_score":5.4,"headline":"Open Redirect","id":"CVE-2021-23385","kev_date_added":null,"published":"2022-08-02"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"PyPA Advisory Database","prefix":"PYSEC"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"},{"class":"attribution","licence":"MIT","name":"Nuclei templates"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":"PUBLISHED","updated":"2024-08-03","vendors":["Flask-Middleware"]},"summary":"Attackers can redirect users to malicious sites via crafted next parameters if Werkzeug's default header correction is disabled.","url":"https://insights.sbomify.com/CVE-2021-32618/"}