Openclaw cli: OpenClaw has stored XSS in exported session HTML viewer via markdown/raw-HTML rendering
Description
OpenClaw CLI versions up to 2026.2.22-2 have a stored cross-site scripting (XSS) vulnerability in the exported session HTML viewer. This occurs because raw HTML markdown tokens and unescaped metadata fields are rendered without proper sanitization, allowing attacker-controlled JavaScript to execute when opening a crafted exported session file. The vulnerability was patched in version 2026.2.23 by escaping raw HTML tokens and metadata fields and adding image MIME sanitization.
CVSS v4.0
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The OpenClaw CLI exported session HTML viewer allowed stored XSS due to rendering markdown with marked.parse(...) and inserting HTML via innerHTML without overriding the html renderer token path. This permitted raw HTML, including malicious scripts (e.g., <img src=x onerror=...>), to be passed through unescaped. Additionally, tree and header metadata fields were interpolated without escaping in the export template. Opening a crafted exported HTML session file could execute attacker-controlled JavaScript in the viewer context, exposing session content and enabling phishing or UI spoofing. The issue was fixed by overriding the marked html(token) renderer to escape raw HTML tokens, escaping metadata fields, adding image MIME sanitization, and regression tests. The fix was released in version 2026.2.23.
Potential Impact
An attacker can craft a session with malicious HTML content that, when exported and opened in the OpenClaw HTML viewer, executes arbitrary JavaScript. This can lead to exposure of session data and enable phishing or UI spoofing attacks within the trusted export view. There is no indication of privilege escalation or remote code execution beyond the viewer context.
Mitigation Recommendations
A patch is available in OpenClaw CLI version 2026.2.23 and later. Users should upgrade to this version or newer to remediate the stored XSS vulnerability. The fix includes escaping raw HTML tokens and metadata fields in the exported HTML and adding image MIME sanitization. No additional mitigation actions are required beyond applying the official fix.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- BREW-openclaw-cli-GHSA-r294-2894-92j3
- Osv Schema Version
- 1.7.3
- Ecosystems
- ["Homebrew"]
- Cvss Version
- 4.0
Threat ID: 6ac2458312601ec6a3164072
Added to database: 10/04/2026, 12:24:35 UTC
Last enriched: 10/04/2026, 12:29:47 UTC
Last updated: 10/04/2026, 12:29:47 UTC
Views: 1
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.