CVE-2021-32618
Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.
NVD · uneditedThe 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`.
Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.
dbcve analysis · high confidenceFlask-Security-Too contains an open redirect vulnerability in its handling of the 'next' query parameter used for post-authentication redirects. The URL validation using Python's urlsplit library checks for relative URLs or same-netloc URLs, but fails to account for browser leniency in parsing incomplete URLs. An attacker can craft URLs like 'http://login?next=\\github.com' which pass the validation but are converted by browsers to 'http://github.com', enabling arbitrary redirects.
Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.
Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.
NVD · CPE dataall versionsCVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.
From the vector- Attack vector
- Network
- Complexity
- Low
- Privileges
- None
- User interaction
- Required
- Scope
- Changed
- Confidentiality
- Low
- Integrity
- Low
- Availability
- None
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.
dbcve checksWork through these to decide whether this CVE applies to you.
-
Confirm Flask-Security-Too is installedRun 'pip show flask-security-too' or check your requirements.txt for the flask-security-too packageAffected if The package is present in the environment
-
Verify Werkzeug autocorrect_location_header settingCheck your Flask application configuration for any explicit setting of 'Werkzeug' or middleware that modifies 'autocorrect_location_header'. Search your codebase for 'autocorrect_location_header' and review Flask/Werkzeug initialization code.Affected if The setting has been explicitly set to False, disabling Werkzeug's default protection
-
Check for custom post-login redirect handlersReview your Flask-Security-Too configuration for 'SECURITY_POST_LOGIN_VIEW' or similar settings. Search for any custom 'after_login' or 'post_login' handlers that override default redirect behavior.Affected if Custom redirect handlers bypass Werkzeug's built-in protection for the 'next' parameter
-
Inspect URL validation in any custom authentication handlersSearch your application code for url validation logic that handles the 'next', 'next', or redirect parameters. Look for uses of urlsplit, urlparse, or similar URL parsing functions.Affected if Custom validation exists that may not properly reject backslash-based URLs like '\\github.com'
The environment is affected only if Flask-Security-Too is in use AND Werkzeug's autocorrect_location_header has been explicitly disabled, OR custom redirect handlers bypass Werkzeug's protection for the 'next' parameter.
Generated from the published advisory. Verify against your own configuration.
Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.
From vendor dataThis is low severity because Werkzeug (default Flask WSGI layer) forces absolute Location headers by default, neutralizing the attack. Ensure Werkzeug's default 'autocorrect_location_header' behavior is not modified, or implement stricter URL validation that rejects backslash-based URL components.
- Consultation2.0 h
- Implementation3.0 h
- Testing2.0 h
- Review / QA1.0 h
An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $2,272.
Scan for this in your stack
Free · runs locallyCheck whether your project pulls in CVE-2021-32618 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.
References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.
Primary sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2021-32618 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
No notes yet
Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.
A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.
- Verified mitigations, workarounds, and config changes
- Version or environment caveats, and links to real fixes
- No weaponised exploit code, or anything meant to cause harm
- No spam, self-promotion, credentials, or personal data