{"id":"CVE-2026-32040","aliases":["CVE-2026-32040","GHSA-2ww6-868g-2c56"],"related":[],"kind":"vulnerability","state":"published","title":"OpenClaw < 2026.2.23 - HTML Injection via Unvalidated Image MIME Type in Data-URL Interpolation","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nThe 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.\n\n## Impact\n\nAn 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.\n\n## Affected components\n\n- `src/auto-reply/reply/export-html/template.js` — line 1032 (tool result images), line 1306 (user message images)\n\n## Reproduction\n\n1. Craft a session entry with an image content block where `mimeType` is set to `image/png\" onerror=\"alert(document.domain)`\n2. Export the session to HTML\n3. Open the exported HTML — the injected `onerror` fires\n\n## Remediation\n\n- Added `sanitizeImageMimeType()` helper that validates mimeType against a whitelist of known image MIME types\n- Falls back to `application/octet-stream` for unrecognized values, preventing attribute breakout\n\n## Fix\n\nhttps://github.com/openclaw/openclaw/pull/24140","format":"markdown","source":"ghsa"},{"lang":"es","text":"Las versiones de OpenClaw anteriores a 2026.2.23 contienen una vulnerabilidad de inyección HTML en el exportador de sesión HTML que permite a los atacantes ejecutar javascript arbitrario mediante la inyección de valores mimeType maliciosos en bloques de contenido de imagen. Los atacantes pueden crear entradas de sesión con atributos mimeType especialmente diseñados que escapan del contexto de URL de datos img src para lograr cross-site scripting cuando se abre el HTML exportado.","source":"nvd"}],"published":"2026-03-03T18:30:39.000Z","modified":"2026-11-08T14:01:56.880Z","severity":{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N","score":2.4,"rating":"LOW"},"severities":[{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N","score":2.4,"rating":"LOW"},{"scorer":"VulnCheck","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","score":4.6,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","score":4.6,"rating":"LOW"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N","rating":"LOW"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"type":"semver","introduced":"0","fixed":"2026.2.23","status":"affected"},{"type":"semver","version":"2026.2.23","status":"unaffected"}],"vendor":"OpenClaw","product":"OpenClaw","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2026.2.23"}],"ecosystem":"npm","package":"openclaw","purl":"pkg:npm/openclaw","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"2026.2.23"}],"vendor":"openclaw","product":"openclaw","cpe":"cpe:2.3:a:openclaw:openclaw:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/openclaw/openclaw/security/advisories/GHSA-2ww6-868g-2c56","tags":["exploit","vendor-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/openclaw/openclaw/pull/24140","tags":["issue-tracking","patch","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://www.vulncheck.com/advisories/openclaw-html-injection-via-unvalidated-image-mime-type-in-data-url-interpolation","tags":["third-party-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-32040","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/openclaw/openclaw/commit/f3adf142c195000cbde31200626a1d8c8b716df9","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/openclaw/openclaw","tags":["package"],"sources":["ghsa"]}],"credits":["Sean Nejad (@allsmog)"],"assigner":"VulnCheck","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-03-21T03:12:48.792Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-32040","url":"https://www.cve.org/CVERecord?id=CVE-2026-32040","licence":"CVE Terms of Use","modified":"2026-11-08T14:01:56.880Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-2ww6-868g-2c56","url":"https://github.com/advisories/GHSA-2ww6-868g-2c56","licence":"CC-BY-4.0","modified":"2026-03-30T13:32:22.044Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-32040","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-32040","licence":"Public domain","modified":"2026-06-17T10:34:59.837Z"}],"updatedAt":"2026-11-25T22:59:16.215Z","epss":{"score":0.00178,"percentile":0.07713,"date":"2026-12-02T12:00:21.000Z"}}