CVE-2026-32040: OpenClaw: XSS via HTML export mimeType injection

MEDIUM
Published March 19, 2026
CISO Take

OpenClaw's HTML session exporter fails to sanitize mimeType values in image content blocks, allowing an attacker with local access to craft sessions that execute arbitrary JavaScript when an exported HTML file is opened in a browser. Despite a medium CVSS of 4.6, this vulnerability ranks in the top 96th EPSS percentile — signaling above-average exploitation interest from the research community. AI agent environments commonly use session exports for auditing, compliance reviews, and incident retrospectives, making the required user interaction a realistic attack trigger rather than a theoretical one. Teams should upgrade to OpenClaw 2026.2.23 immediately; if patching is not possible, disable HTML session export and scan previously exported files for unexpected script payloads.

Sources: NVD EPSS GitHub Advisory ATLAS VulnCheck

What is the risk?

Moderate-to-elevated practical risk despite the medium CVSS. The local attack vector and required user interaction constrain mass exploitation, but AI agent workflows frequently involve sharing session exports for review or compliance evidence — making the 'user opens exported file' trigger operationally plausible. EPSS top 96th percentile signals higher-than-average exploitation interest even without a public PoC. The 396 other CVEs in the same OpenClaw package suggest a sustained vulnerability track record warranting elevated scrutiny of any deployment. No CISA KEV listing or active exploitation evidence reduces immediate crisis-level urgency, but the XSS primitive in an AI agent context (session tokens, API call history, tool outputs) elevates impact potential above a typical web XSS.

How does the attack unfold?

Session Crafting
Attacker with local OpenClaw access creates a session entry with a malicious mimeType value in an image content block, embedding a JavaScript payload that breaks out of the data-URL context.
AML.T0043.003
Export and Delivery
Attacker exports the crafted session as HTML and delivers it to a target via email or shared drive, framed as a routine AI session log or compliance audit artifact.
AML.T0011.003
User Execution
Victim opens the exported HTML file in a browser; the injected mimeType breaks the sanitization boundary and triggers arbitrary JavaScript execution in the victim's browser context.
AML.T0011
Credential and Data Exfiltration
Injected JavaScript silently exfiltrates browser session tokens, authentication cookies, or sensitive AI session content to an attacker-controlled endpoint.
AML.T0037

What systems are affected?

Package Ecosystem Vulnerable Range Patched
OpenClaw pip No patch
4 dependents 37% patched ~3d to patch Full package profile →

Do you use OpenClaw? You're affected.

How severe is it?

CVSS 3.1
4.6 / 10
EPSS
0.1%
chance of exploitation in 30 days
Higher than 5% of all CVEs
Exploitation Status
No known exploitation
Sophistication
Trivial

What is the attack surface?

AV AC PR UI S C I A
AV Local
AC Low
PR Low
UI Required
S Changed
C Low
I Low
A None

What should I do?

4 steps
  1. Patch: Upgrade to OpenClaw 2026.2.23 or later — PR #24140 addresses the mimeType sanitization gap in the HTML exporter.

  2. Workaround: Disable HTML session export functionality until patching is complete; substitute JSON or plaintext export formats that do not render in browsers.

  3. Detection: Scan existing exported HTML files for anomalous data URI patterns — flag mimeType values outside standard image/* types (regex: data:[^;"\s]+;base64 with non-standard MIME prefixes) and inspect for embedded script tags or event handlers.

  4. Governance: Classify OpenClaw session exports as potentially sensitive artifacts; restrict distribution to secure channels and apply content inspection controls at email gateways.

What does CISA's SSVC say?

Decision Track
Exploitation none
Automatable No
Technical Impact partial

Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.

How is it classified?

Which compliance frameworks are affected?

This CVE is relevant to:

EU AI Act
Article 9 - Risk management system
ISO 42001
A.9.3 - AI system security
NIST AI RMF
MS-2.5 - AI risk and benefit analysis
OWASP LLM Top 10
LLM05:2025 - Improper Output Handling

Frequently Asked Questions

What is CVE-2026-32040?

OpenClaw's HTML session exporter fails to sanitize mimeType values in image content blocks, allowing an attacker with local access to craft sessions that execute arbitrary JavaScript when an exported HTML file is opened in a browser. Despite a medium CVSS of 4.6, this vulnerability ranks in the top 96th EPSS percentile — signaling above-average exploitation interest from the research community. AI agent environments commonly use session exports for auditing, compliance reviews, and incident retrospectives, making the required user interaction a realistic attack trigger rather than a theoretical one. Teams should upgrade to OpenClaw 2026.2.23 immediately; if patching is not possible, disable HTML session export and scan previously exported files for unexpected script payloads.

Is CVE-2026-32040 actively exploited?

No confirmed active exploitation of CVE-2026-32040 has been reported, but organizations should still patch proactively.

How to fix CVE-2026-32040?

1. Patch: Upgrade to OpenClaw 2026.2.23 or later — PR #24140 addresses the mimeType sanitization gap in the HTML exporter. 2. Workaround: Disable HTML session export functionality until patching is complete; substitute JSON or plaintext export formats that do not render in browsers. 3. Detection: Scan existing exported HTML files for anomalous data URI patterns — flag mimeType values outside standard image/* types (regex: `data:[^;"\s]+;base64` with non-standard MIME prefixes) and inspect for embedded script tags or event handlers. 4. Governance: Classify OpenClaw session exports as potentially sensitive artifacts; restrict distribution to secure channels and apply content inspection controls at email gateways.

What systems are affected by CVE-2026-32040?

This vulnerability affects the following AI/ML architecture patterns: agent frameworks, AI session management and audit workflows, collaborative AI agent environments.

What is the CVSS score for CVE-2026-32040?

CVE-2026-32040 has a CVSS v3.1 base score of 4.6 (MEDIUM). The EPSS exploitation probability is 0.15%.

What is the AI security impact?

Affected AI Architectures

agent frameworksAI session management and audit workflowscollaborative AI agent environments

MITRE ATLAS Techniques

AML.T0011 User Execution
AML.T0037 Data from Local System
AML.T0043.003 Manual Modification
AML.T0080.001 Thread

Compliance Controls Affected

EU AI Act: Article 9
ISO 42001: A.9.3
NIST AI RMF: MS-2.5
OWASP LLM Top 10: LLM05:2025

What are the technical details?

Original Advisory

OpenClaw versions prior to 2026.2.23 contain an html injection vulnerability in the HTML session exporter that allows attackers to execute arbitrary javascript by injecting malicious mimeType values in image content blocks. Attackers can craft session entries with specially crafted mimeType attributes that break out of the img src data-URL context to achieve cross-site scripting when exported HTML is opened.

Exploitation Scenario

An attacker with limited local access to an OpenClaw deployment creates a new session and adds an image content block. They craft a mimeType attribute value that breaks out of the data-URL context — for example, injecting closing quotes and an onerror handler — embedding a payload that exfiltrates cookies or session tokens to an attacker-controlled endpoint. The attacker exports the session as HTML and delivers it to a target (a security analyst, compliance auditor, or teammate) via email or a shared drive, framed as a routine session log. When the recipient opens the file in their browser, the injected JavaScript fires silently, exfiltrating authentication tokens or any sensitive AI session data visible in the browser context. Given that AIID #1368 documents prior credential exfiltration abuse within the OpenClaw skills ecosystem, this delivery pattern is operationally consistent with known threat actor behavior against OpenClaw deployments.

Weaknesses (CWE)

CWE-79 — Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'): The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.

  • [Architecture and Design] Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid [REF-1482]. Examples of libraries and frameworks that make it easier to generate properly encoded output include Microsoft's Anti-XSS library, the OWASP ESAPI Encoding module, and Apache Wicket.
  • [Implementation, Architecture and Design] Understand the context in which your data will be used and the encoding that will be expected. This is especially important when transmitting data between different components, or when generating outputs that can contain multiple encodings at the same time, such as web pages or multi-part mail messages. Study all expected communication protocols and data representations to determine the required encoding strategies. For any data that will be output to another web page, especially any data that was received from external inputs, use the appropriate encoding on all non-alphanumeric characters. Parts of the same output document may require different encodings, which will vary depending on whether the output is in the: etc. Note that HTML Entity Encoding is only appropriate for the HTML body. Consult the XSS Prevention Cheat Sheet [REF-724] for more details on the types of encoding and escaping that are needed. HTML body Element attributes (such as src="XYZ") URIs JavaScript sections Casca

Source: MITRE CWE corpus.

CVSS Vector

CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N

Timeline

Published
March 19, 2026
Last Modified
June 23, 2026
First Seen
June 23, 2026

Related Vulnerabilities