Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2025-5412 Overview
CVE-2025-5412 is a cross-site scripting (XSS) vulnerability in Mist Community Edition up to version 4.7.1. The flaw resides in the Login function of src/mist/api/views.py within the Authentication Endpoint component. Attackers can manipulate the return_to argument to inject script content that executes in the victim's browser. The vulnerability is remotely exploitable and requires user interaction, such as clicking a crafted link. Public disclosure has occurred, including a proof-of-concept demonstrating open redirect behavior tied to the same input. Mist resolved the issue in version 4.7.2 via commit db10ecb62ac832c1ed4924556d167efb9bc07fad.
Critical Impact
Attackers can craft malicious login URLs that execute arbitrary JavaScript in authenticated user sessions, enabling credential theft and session abuse.
Affected Products
- Mist Community Edition versions up to and including 4.7.1
- mist:mist component (community distribution)
- Deployments relying on the unpatched Authentication Endpoint (src/mist/api/views.py)
Discovery Timeline
- 2025-06-02 - CVE-2025-5412 published to the National Vulnerability Database
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2025-5412
Vulnerability Analysis
The vulnerability is a reflected cross-site scripting flaw [CWE-79] in the authentication flow of Mist Community Edition. The Login view accepts a return_to request parameter intended to redirect users after successful login. The parameter is reflected back into the response without proper output encoding or input validation. An attacker can supply a crafted payload that executes JavaScript in the context of the Mist web application. Related research has also demonstrated open redirect behavior through the same parameter, broadening the phishing surface. The upstream patch introduces a SameSite=Strict cookie flag and tightens parameter handling in authentication middleware.
Root Cause
The root cause is improper neutralization of input used in a web page. The return_to argument flows from an untrusted HTTP request into a response context without sanitization or contextual escaping. Because the endpoint is unauthenticated and accessible over the network, any attacker can craft payloads targeting Mist users.
Attack Vector
Exploitation is network-based and requires a victim to interact with an attacker-supplied URL. The attacker embeds a malicious return_to value in a link to the Mist login page and lures a user, typically through phishing. When the user visits the link, the injected script executes in the Mist origin, where it can read tokens, submit forms, or chain into account takeover attempts.
# Security patch in src/mist/api/auth/middleware.py (v4.7.2)
if isinstance(session, SessionToken) and \
not getattr(session, 'internal', False) and \
not session.last_accessed_at:
# (CSRF) Security Fix: Added SameSite=Strict flag to prevent CSRF attack
# in admin's "su" operation. In case of having a cookie issue, consider
# removing and addressing the CSRF issue in another way
cookie = 'session.id=%s; Path=/; SameSite=Strict;' % session.token
headers.append(('Set-Cookie', cookie))
Source: GitHub Commit db10ecb
Detection Methods for CVE-2025-5412
Indicators of Compromise
- HTTP requests to the Mist login endpoint containing suspicious characters in the return_to parameter, including <, >, javascript:, or encoded script fragments.
- Referer headers pointing to attacker-controlled domains that redirect users to the Mist login page with crafted query strings.
- Unexpected outbound requests from browsers immediately after visiting the Mist login URL, indicating script execution and token exfiltration.
Detection Strategies
- Inspect web server and reverse proxy logs for anomalous return_to values submitted to /auth or related login routes in src/mist/api/views.py.
- Deploy a web application firewall rule that flags XSS payload patterns in query string parameters delivered to the Mist login endpoint.
- Correlate session anomalies, such as sudden token reuse from new IP addresses, with recent accesses to the login page carrying unusual parameters.
Monitoring Recommendations
- Enable Content Security Policy violation reporting to surface injection attempts against the Mist web interface.
- Alert on high-volume or distributed access patterns against the login endpoint with non-standard return_to payloads.
- Review authentication logs for session cookies issued immediately before suspicious API calls or configuration changes.
How to Mitigate CVE-2025-5412
Immediate Actions Required
- Upgrade Mist Community Edition to version 4.7.2 or later, which contains commit db10ecb62ac832c1ed4924556d167efb9bc07fad.
- Invalidate active sessions after upgrading to force re-authentication and eliminate any tokens potentially captured through prior exploitation.
- Audit authentication logs for suspicious return_to values and investigate accounts tied to those requests.
Patch Information
The fix is included in Mist Community Edition v4.7.2. Review the GitHub Mist.io Release v4.7.2 notes and the GitHub Commit Details for the full set of changes, which address XSS handling and add a SameSite=Strict flag to session cookies. Additional context is available in the VulDB #310752 Overview and the GitHub Open Redirect PoC.
Workarounds
- Restrict access to the Mist Community Edition web console using IP allowlists or VPN enforcement until the upgrade is deployed.
- Add a reverse proxy rule that strips or validates the return_to parameter, rejecting values containing HTML or script characters.
- Enforce a strict Content Security Policy that disallows inline scripts to reduce the impact of reflected payloads.
# Example nginx rule to drop requests with suspicious return_to values
if ($arg_return_to ~* "(<|>|javascript:|script|%3C|%3E)") {
return 400;
}
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

