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.
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.
src/auto-reply/reply/export-html/template.js — line 1032 (tool result images), line 1306 (user message images)mimeType is set to image/png" onerror="alert(document.domain)onerror firessanitizeImageMimeType() helper that validates mimeType against a whitelist of known image MIME typesapplication/octet-stream for unrecognized values, preventing attribute breakouthttps://github.com/openclaw/openclaw/pull/24140
{
"cwe_ids": [
"CWE-79"
],
"github_reviewed": true,
"nvd_published_at": "2026-03-19T22:16:40Z",
"severity": "LOW",
"github_reviewed_at": "2026-03-03T18:30:39Z"
}