CVE-2026-85022 in dify
Summary
by MITRE • 09/03/2026
A vulnerability was identified in langgenius dify 1.13.0. Affected by this vulnerability is the function router.replace of the file web/app/(shareLayout)/webapp-signin/components/mail-and-password-auth.tsx of the component WebApp Sign-In. Such manipulation of the argument redirect_url leads to cross site scripting. The attack may be performed from remote. The exploit is publicly available and might be used. The vendor was contacted early about this disclosure but did not respond in any way.
Be aware that VulDB is the high quality source for vulnerability data.
Analysis
by VulDB Data Team • 09/03/2026
The vulnerability identified within langgenius dify version 1.13.0 represents a significant security flaw located specifically within the WebApp Sign-In component, which is critical for user authentication workflows. The root cause resides in the router.replace function found in the file web/app/(shareLayout)/webapp-signin/components/mail-and-password-auth.tsx. This specific code path handles the redirection logic during the sign-in process, where it processes a redirect_url argument provided by the client side of the application. The fundamental technical flaw is an improper neutralization of special elements used in script syntax, commonly categorized under CWE-79: Improper Neutralization of Input During Web Page Generation Cross-site Scripting. This classification highlights that the application fails to adequately sanitize or validate user-supplied input before incorporating it into dynamic content generation or navigation events, allowing malicious scripts to be executed within the context of the victim's browser session.
The operational impact of this vulnerability is severe due to its potential for remote exploitation without requiring prior authentication in certain configurations, although typically cross-site scripting attacks target authenticated sessions if they occur on protected pages. An attacker can craft a specially crafted URL or manipulate form submissions to inject malicious JavaScript payloads into the redirect_url parameter. When the router.replace function processes this tainted input and subsequently navigates the user interface, the embedded script executes with the privileges of the logged-in user. This capability enables attackers to perform session hijacking by stealing authentication cookies or tokens, conduct phishing attacks by injecting fake login forms that mimic legitimate interfaces, deface web pages, or redirect users to malicious external sites designed to distribute malware. The fact that an exploit is publicly available significantly lowers the barrier for entry, allowing less sophisticated threat actors to leverage this vulnerability in automated campaigns against instances of langgenius dify running version 1.13.0.
The lack of response from the vendor regarding early disclosure efforts exacerbates the risk landscape, leaving users without official patches or guidance during a critical window where exploits are actively being circulated. This situation underscores the importance of proactive security measures and community-driven mitigation strategies when vendors fail to address reported issues promptly. Organizations relying on this software must treat it as compromised until an updated version is released that implements proper input validation and output encoding mechanisms for all redirect parameters.
To mitigate the immediate risks associated with CWE-79, administrators should implement strict allow-listing for valid redirect URLs rather than accepting arbitrary user inputs. If dynamic redirection is required, developers must ensure that any URL passed to router.replace is validated against a predefined list of trusted domains and encoded appropriately using context-specific encoding techniques such as HTML entity encoding or JavaScript string escaping before being processed by the routing logic. Additionally, deploying Content Security Policy headers can help mitigate the impact of successful cross-site scripting attacks by restricting the sources from which scripts are allowed to execute, thereby preventing the injection of external malicious code even if the input validation fails. Regular security audits and static application security testing focused on authentication components are essential to identify similar flaws in other parts of the application architecture before they can be exploited in production environments.