Openclaw cli: OpenClaw Vulnerable to HTML injection via unvalidated image MIME type in data-URL interpolation (CVE-2026-32040)
Description
OpenClaw CLI contains a vulnerability in its HTML session exporter where image MIME types are interpolated into data-URL image sources without proper validation or escaping. This allows an attacker who can control image MIME types in session data to inject arbitrary JavaScript via crafted MIME types, leading to cross-site scripting (XSS) when the exported HTML is opened. The vulnerability affects versions from 2026.1.29 up to but not including 2026.2.23. A fix has been implemented by adding a sanitization helper that validates MIME types against a whitelist and defaults to a safe value for unrecognized types.
CVSS v3.1
Score 4.6medium
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The OpenClaw CLI's HTML session exporter (`src/auto-reply/reply/export-html/template.js`) directly interpolates the `img.mimeType` value into `<img src="data:...">` attributes without validation or escaping. An attacker controlling image entries in session data can craft a MIME type such as `image/png" onerror="alert(document.domain)` to break out of the attribute context and execute arbitrary JavaScript when the exported HTML is opened. This XSS vulnerability requires control over image content blocks but is straightforward to exploit. The issue affects versions >=2026.1.29 and <2026.2.23. The vendor fixed the issue by introducing a `sanitizeImageMimeType()` function that validates MIME types against a whitelist and falls back to `application/octet-stream` for invalid values, preventing attribute breakout.
Potential Impact
An attacker with the ability to manipulate image MIME types in session data can execute arbitrary JavaScript in the context of the exported HTML file, resulting in a cross-site scripting (XSS) vulnerability. This can lead to information disclosure or other client-side impacts when the exported HTML is viewed. The vulnerability requires local or limited privileges (AV:L, PR:L) and user interaction (UI:R) to open the exported HTML. The CVSS score is 4.6 (medium severity).
Mitigation Recommendations
A patch is available and has been applied in versions 2026.2.23 and later. The fix involves sanitizing the image MIME type against a whitelist and defaulting to a safe MIME type for unrecognized values, preventing attribute injection. Users should upgrade to version 2026.2.23 or later to remediate this vulnerability.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- BREW-openclaw-cli-CVE-2026-32040
- Osv Schema Version
- 1.7.3
- Ecosystems
- ["Homebrew"]
- Cvss Version
- 3.1
Threat ID: 6ac245da12601ec6a31680ac
Added to database: 10/04/2026, 12:26:02 UTC
Last enriched: 10/04/2026, 13:21:09 UTC
Last updated: 10/04/2026, 16:08:37 UTC
Views: 4
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.