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 <img src="data:..."> 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
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| npm package | openclaw | < 2026.2.23 | 2026.2.23 |
References
- https://github.com/openclaw/openclaw/security/advisories/GHSA-2ww6-868g-2c56
- https://nvd.nist.gov/vuln/detail/CVE-2026-32040
- https://github.com/openclaw/openclaw/pull/24140
- https://github.com/openclaw/openclaw/commit/f3adf142c195000cbde31200626a1d8c8b716df9
- https://github.com/openclaw/openclaw
- https://www.vulncheck.com/advisories/openclaw-html-injection-via-unvalidated-image-mime-type-in-data-url-interpolation
- CVSS vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N- Weakness (CWE)
CWE-79- Platform
- npm
- Package
openclaw- Disclosed
- 03.03.2026
- Updated
- 11.10.2026 10:22
Sources and licenses
OSV / GitHub Advisory Database - GHSA-2ww6-868g-2c56 - CC BY 4.0
Vulnerability history: openclaw
All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 588
- First → latest
- 02.2026 07.2026
- Without a fix
- 9
- Exploited in attacks
- 0
Severity breakdown
- Critical 20
- High 215
- Medium 299
- Low 54
Disclosures per year
- 2026: 588
-
OpenClaw Vulnerable to HTML injection via unvalidated image MIME type in data-URL interpolation this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.