Researchers have disclosed a high-severity code injection vulnerability, CVE-2025-64496, in Open WebUI, a widely used open-source web interface for interacting with self-hosted AI models like Ollama. Discovered by researchers at Cato Networks, the flaw allows a malicious AI model server to execute arbitrary JavaScript code in the context of a user's browser. An attacker can exploit this by tricking a user into connecting their Open WebUI instance to a malicious server endpoint. This leads to the theft of authentication tokens and complete account takeover. Crucially, if the compromised user has workspace.tools permissions, the attacker can leverage the stolen token to achieve remote code execution (RCE) on the Open WebUI host server. The vulnerability affects versions 0.6.34 and older and has been remediated in version 0.6.35.
The vulnerability exists within the 'Direct Connections' feature of Open WebUI. This feature allows users to connect to any OpenAI-compatible API endpoint, not just locally hosted models. The flaw lies in how the Open WebUI front-end processes Server-Sent Events (SSE) received from these external servers. An attacker can set up a malicious server that, when a user sends it a prompt, responds with a specially crafted SSE payload. Instead of a normal text response, the payload contains a malicious JavaScript instruction. The Open WebUI front-end fails to properly sanitize this response and executes the script in the user's browser.
The exploitation chain is as follows:
event: 'execute', data: 'alert(1)').localStorage to steal the user's JSON Web Token (JWT) authentication token.workspace.tools permission enabled, the attacker can use the stolen token to make an authenticated API call to create a new 'tool'. This tool can be configured to execute arbitrary Python code on the underlying server, achieving full RCE without any sandboxing.The impact is severe. At a minimum, it allows for complete account takeover, leading to the theft of potentially sensitive information processed by the AI model, including proprietary code, business documents, and personal data. The escalation path to RCE is the most critical aspect. An attacker with RCE on the server can install persistent backdoors, pivot to other systems on the network, or use the server to launch further attacks. Given that Open WebUI is often used by developers and researchers, the compromised server could be a high-value target with access to other critical infrastructure.
execute event from being processed from Direct Connections servers, neutralizing the vulnerability.workspace.tools permission. This permission should be granted on a principle of least privilege, as it represents a significant security risk if a user account is compromised. This is a form of D3FEND's User Account Permissions (D3-UAP).Updating Open WebUI to the patched version is the primary and most effective mitigation.
Mapped D3FEND Techniques:
Restricting the high-risk 'workspace.tools' permission based on the principle of least privilege limits the potential impact of an account compromise.
Restricting or disabling the 'Direct Connections' feature hardens the application against this specific attack vector.
Mapped D3FEND Techniques:
The most critical and immediate action for all organizations using Open WebUI is to apply the security patch. Administrators must identify all instances of Open WebUI within their environment and upgrade them to version 0.6.35 or higher. This is not a complex mitigation; it is a straightforward software update that directly remediates the root cause of CVE-2025-64496. The patched version correctly sanitizes server-sent events, preventing the code injection that enables the entire attack chain. Delaying this patch leaves the organization exposed to account takeover and potential remote code execution. A robust patch management program that can quickly identify and update vulnerable software is essential for modern cybersecurity.
As a vital secondary defense, administrators should conduct a thorough audit of user permissions within Open WebUI. The ability to escalate from account takeover to RCE hinges entirely on the compromised user having the workspace.tools permission. This permission is powerful and should be treated as a high-privilege capability. It should only be assigned to a minimal number of trusted users who have a clear, documented need for it. By applying the principle of least privilege, organizations can significantly limit the blast radius of a compromised account. Even if an attacker successfully steals a standard user's token via CVE-2025-64496, they will be unable to escalate to RCE if that user does not have the necessary permissions. This control contains the incident to data exposure rather than a full server compromise.

Cybersecurity professional with over 10 years of specialized experience in security operations, threat intelligence, incident response, and security automation. Expertise spans SOAR/XSOAR orchestration, threat intelligence platforms, SIEM/UEBA analytics, and building cyber fusion centers. Background includes technical enablement, solution architecture for enterprise and government clients, and implementing security automation workflows across IR, TIP, and SOC use cases.
Help others stay informed about cybersecurity threats