{"id":"GHSA-r294-2894-92j3","aliases":[],"status":"published","title":"OpenClaw has stored XSS in exported session HTML viewer via markdown/raw-HTML rendering","description":"## Summary\n\nThe exported session HTML viewer allowed stored XSS when untrusted session content included raw HTML markdown tokens or unescaped metadata fields.\n\n## Impact\n\nOpening a crafted exported HTML session could execute attacker-controlled JavaScript in the viewer context. This can expose session content in the page and enable phishing or UI spoofing in the trusted export view.\n\n## Affected Packages / Versions\n\n- Package: `openclaw` (npm)\n- Affected versions: `\u003c= 2026.2.22-2`\n- Patched version (released): `\u003e= 2026.2.23`\n\n## Technical Details\n\nThe exporter rendered markdown with `marked.parse(...)` and inserted HTML via `innerHTML`, but did not override the `html` renderer token path. Raw HTML (for example `\u003cimg ... onerror=...\u003e`) was passed through. Additional tree/header metadata fields were interpolated without escaping in the export template.\n\n## Reproduction\n\n1. Create a session containing content like `\u003cimg src=x onerror=alert(1)\u003e`.\n2. Export the session to HTML.\n3. Open the exported file.\n4. Observe script execution from injected content.\n\n## Remediation\n\n- Added a `marked` `html(token)` renderer override that escapes raw HTML tokens.\n- Escaped previously unescaped tree/header metadata fields in the export template.\n- Added image MIME sanitization for exported data-URL image rendering.\n- Added regression tests for markdown/token and metadata escaping paths.\n\n## Fix Commit(s)\n\n- `f8524ec77a3999d573e6c6b8a5055bf35c49a2e6`\n\n## Release Process Note\n\n`patched_versions` is pre-set to the released version (`\u003e= 2026.2.23`). This advisory now reflects released fix version `2026.2.23`.\n\nOpenClaw thanks @allsmog for reporting.","severity":{"version":"4.0","score":5.3,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N","level":"medium","from":"ghsa"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-79"],"published":"2026-03-03T22:09:26Z","modified":"2026-03-04T15:16:22Z","fixes":[{"ecosystem":"npm","package":"openclaw","fixed_in":["2026.2.23"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"openclaw","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2026.2.23"}]}]},{"source":"osv","ecosystem":"npm","package":"openclaw","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"2026.2.23"}]}]}],"references":[{"url":"https://github.com/openclaw/openclaw/security/advisories/GHSA-r294-2894-92j3","tags":["web"]},{"url":"https://github.com/openclaw/openclaw/commit/f8524ec77a3999d573e6c6b8a5055bf35c49a2e6","tags":["web"]},{"url":"https://github.com/advisories/GHSA-r294-2894-92j3"},{"url":"https://github.com/openclaw/openclaw","tags":["package"]}],"sources":{"ghsa":[{"id":"GHSA-r294-2894-92j3","title":"OpenClaw has stored XSS in exported session HTML viewer via markdown/raw-HTML rendering","description":"## Summary\n\nThe exported session HTML viewer allowed stored XSS when untrusted session content included raw HTML markdown tokens or unescaped metadata fields.\n\n## Impact\n\nOpening a crafted exported HTML session could execute attacker-controlled JavaScript in the viewer context. This can expose session content in the page and enable phishing or UI spoofing in the trusted export view.\n\n## Affected Packages / Versions\n\n- Package: `openclaw` (npm)\n- Affected versions: `\u003c= 2026.2.22-2`\n- Patched version (released): `\u003e= 2026.2.23`\n\n## Technical Details\n\nThe exporter rendered markdown with `marked.parse(...)` and inserted HTML via `innerHTML`, but did not override the `html` renderer token path. Raw HTML (for example `\u003cimg ... onerror=...\u003e`) was passed through. Additional tree/header metadata fields were interpolated without escaping in the export template.\n\n## Reproduction\n\n1. Create a session containing content like `\u003cimg src=x onerror=alert(1)\u003e`.\n2. Export the session to HTML.\n3. Open the exported file.\n4. Observe script execution from injected content.\n\n## Remediation\n\n- Added a `marked` `html(token)` renderer override that escapes raw HTML tokens.\n- Escaped previously unescaped tree/header metadata fields in the export template.\n- Added image MIME sanitization for exported data-URL image rendering.\n- Added regression tests for markdown/token and metadata escaping paths.\n\n## Fix Commit(s)\n\n- `f8524ec77a3999d573e6c6b8a5055bf35c49a2e6`\n\n## Release Process Note\n\n`patched_versions` is pre-set to the released version (`\u003e= 2026.2.23`). This advisory now reflects released fix version `2026.2.23`.\n\nOpenClaw thanks @allsmog for reporting.","status":"published","published":"2026-03-03T22:09:26Z","modified":"2026-03-03T22:09:28Z","cvss":[{"version":"4.0","score":5.3,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N","level":"medium"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T14:39:30.031684Z"}],"osv":[{"id":"GHSA-r294-2894-92j3","title":"OpenClaw has stored XSS in exported session HTML viewer via markdown/raw-HTML rendering","description":"## Summary\n\nThe exported session HTML viewer allowed stored XSS when untrusted session content included raw HTML markdown tokens or unescaped metadata fields.\n\n## Impact\n\nOpening a crafted exported HTML session could execute attacker-controlled JavaScript in the viewer context. This can expose session content in the page and enable phishing or UI spoofing in the trusted export view.\n\n## Affected Packages / Versions\n\n- Package: `openclaw` (npm)\n- Affected versions: `\u003c= 2026.2.22-2`\n- Patched version (released): `\u003e= 2026.2.23`\n\n## Technical Details\n\nThe exporter rendered markdown with `marked.parse(...)` and inserted HTML via `innerHTML`, but did not override the `html` renderer token path. Raw HTML (for example `\u003cimg ... onerror=...\u003e`) was passed through. Additional tree/header metadata fields were interpolated without escaping in the export template.\n\n## Reproduction\n\n1. Create a session containing content like `\u003cimg src=x onerror=alert(1)\u003e`.\n2. Export the session to HTML.\n3. Open the exported file.\n4. Observe script execution from injected content.\n\n## Remediation\n\n- Added a `marked` `html(token)` renderer override that escapes raw HTML tokens.\n- Escaped previously unescaped tree/header metadata fields in the export template.\n- Added image MIME sanitization for exported data-URL image rendering.\n- Added regression tests for markdown/token and metadata escaping paths.\n\n## Fix Commit(s)\n\n- `f8524ec77a3999d573e6c6b8a5055bf35c49a2e6`\n\n## Release Process Note\n\n`patched_versions` is pre-set to the released version (`\u003e= 2026.2.23`). This advisory now reflects released fix version `2026.2.23`.\n\nOpenClaw thanks @allsmog for reporting.","status":"published","published":"2026-03-03T22:09:26Z","modified":"2026-03-04T15:16:22.593407Z","cvss":[{"version":"4.0","score":5.3,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N","level":"medium"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T15:46:55.122811Z"}]}}
