CVE-2026-32040: OpenClaw Vulnerable to HTML injection via unvalidated image MIME type in data-URL interpolation
Summary The HTML session exporter (src/auto-reply/reply/export-html/template.js) interpolates img.mimeType directly into attributes without validation or escaping. A crafted mimeType value (e.g., x" onerror="alert(1)) can break out of the attribute context and execute arbitrary JavaScript.
Published Mar 3, 2026 · Updated Mar 30, 2026
Affected packages
openclaw
- Ecosystem
- npm
- Affected
- < 2026.2.23
- Fixed in
- 2026.2.23
- Check
npm ls openclaw
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
The HTML session exporter (src/auto-reply/reply/export-html/template.js) interpolates img.mimeType directly into ` attributes without validation or escaping. A crafted mimeType value (e.g., x" onerror="alert(1)`) can break out of the attribute context and execute arbitrary JavaScript.
Impact
An attacker who can control image entries in session data (via crafted tool results or session manipulation) can achieve XSS when the exported HTML is opened. The precondition is tighter than the main XSS finding (requires image content blocks with a malicious mimeType), but exploitation is straightforward.
Affected components
src/auto-reply/reply/export-html/template.js— line 1032 (tool result images), line 1306 (user message images)
Reproduction
- Craft a session entry with an image content block where
mimeTypeis set toimage/png" onerror="alert(document.domain) - Export the session to HTML
- Open the exported HTML — the injected
onerrorfires
Remediation
- Added
sanitizeImageMimeType()helper that validates mimeType against a whitelist of known image MIME types - Falls back to
application/octet-streamfor unrecognized values, preventing attribute breakout
Fix
https://github.com/openclaw/openclaw/pull/24140
Credited to allsmog.
References
- https://github.com/openclaw/openclaw/security/advisories/GHSA-2ww6-868g-2c56
- https://github.com/openclaw/openclaw/pull/24140
- https://github.com/openclaw/openclaw/commit/f3adf142c195000cbde31200626a1d8c8b716df9
- https://nvd.nist.gov/vuln/detail/CVE-2026-32040
- https://www.vulncheck.com/advisories/openclaw-html-injection-via-unvalidated-image-mime-type-in-data-url-interpolation
- https://github.com/advisories/GHSA-2ww6-868g-2c56
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More OpenClaw vulnerabilities
All OpenClaw entriesCVE-2026-35630
OpenClaw: QQBot native approval buttons did not enforce configured approver identity
high8.0Jul 2, 2026CVE-2026-53806
OpenClaw: Combined POSIX shell options could confuse exec revalidation
high8.8Jul 2, 2026CVE-2026-53809
OpenClaw: Embedded runner policy could be confused by provider aliases
medium3.8Jul 2, 2026CVE-2026-53810
OpenClaw's marketplace runtime extension metadata could point at unscanned payloads
high8.8Jul 2, 2026CVE-2026-53811
OpenClaw: Matrix allowFrom could bind to mutable display names
high8.8Jul 2, 2026CVE-2026-53812
OpenClaw's browser act interactions could bypass private-network navigation checks
medium7.7Jul 2, 2026
