Repository navigation
fix: [website] prevent external redirects after login - #1121
Merged
Merged
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Member
Author
|
Security advisory https://vulnerability.circl.lu/vuln/gcve-1-2026-20325 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A successful website login redirects directly to the user-supplied
nextURL. This remains unfixed at upstream HEAD0d56f9c2da50adbbb1b3c977e571344953b820bdand is also present in releasev3.1.4. A regression test using the real login form, valid CSRF token and administrator password reproduced a 302 withLocation: https://evil.example/phishbefore this patch. Addresses the issue reported in #872.Validate the destination and emit only a local path. Preserve ordinary local destinations and convert HTTP(S) URLs with the same host and port to local paths, retaining queries and fragments. Reject external authorities, userinfo, unsupported or malformed schemes, browser-ambiguous slash/backslash forms, control characters and malformed URLs; fall back to
/.The netloc-only check proposed in #872 also accepts
https:///evil.example/phishbecause Python parses an empty netloc. Flask emits that Location unchanged, and a WHATWG URL parser resolves it tohttps://evil.example/phish. This patch rejects that form and normalizes accepted destinations before redirecting.Validation
PYTHONPATH=website/tests .venv/bin/python -m unittest login_checks external_tools_checks import_checks export_checks -q— 42 tests passed.git diff --checkpassed for the changed files.Security advisory assessment
Recommendation: publish a security advisory and request a CVE and/or GCVE identifier through the responsible CNA/GNA. This is a reproducible CWE-601 open redirect in the optional standalone website. A remote attacker can craft a login URL that sends a victim to an attacker-controlled site after the victim successfully authenticates, increasing the credibility of a phishing flow. The demonstrated behavior does not automatically disclose the submitted password or session cookie.
Confirmed affected source:
v3.1.4and the checked upstream HEAD. The vulnerable login redirect was introduced in4426a51193973b1c0a6e8614b5d3ee8e797f91bc(2024-02-29). Earlier affected release bounds and the first fixed release should be confirmed when publishing the advisory. The issue concerns the Flask website, rather than the module daemon alone or the separate MISP core login implementation.Identifier assignment is a CNA/GNA decision, rather than an automatic consequence of opening this PR. CNA rules §4.2.2 support assignment for evidenced, publicly disclosed vulnerabilities within scope; GCVE BCP-04 describes GNA allocation and cross-referencing. No matching public identifier was found in the searches performed; check existing reservations before requesting a new one. This PR does not allocate or publish an advisory identifier.