CVE-2026-32040: Openclaw OpenClaw Vulnerable To HTML Injection Vulnerability
LOWCVE-2026-32040 is a LOW (CVSS 4.6) openclaw vulnerable to html injection vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Openclaw libraries in the npm ecosystem. The issue involves openclaw vulnerable to html injection via unvalidated image mime type in data-url interpolation. Remediation is available by upgrading affected packages to version 2026.2.23.
CVE-2026-32040 at a Glance
Security Impact
CVSS: 4.6
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N).
How to Fix CVE-2026-32040
To remediate this vulnerability, upgrade all affected Openclaw dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install openclaw@2026.2.23
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls openclaw
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2026-32040, inspect your project dependencies using npm:
npm ls openclaw
Analyze the terminal output to locate any version of Openclaw in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2026.2.23), your application is affected.
Note: The npm ls openclaw command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Openclaw, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-32040 Affected Openclaw Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
openclaw
|
npm |
< 2026.2.23
|
2026.2.23
|
References
Frequently Asked Questions
What is CVE-2026-32040?
Which Openclaw versions are affected?
What version fixes CVE-2026-32040?
Is openclaw affected?
What is the CVSS score of CVE-2026-32040?
What CWE is associated with CVE-2026-32040?
How can I check npm dependencies for CVE-2026-32040?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-2ww6-868g-2c56",
"modified" : "2026-03-30T13:17:36Z",
"published" : "2026-03-03T18:30:39Z",
"aliases" : [ "CVE-2026-32040" ],
"summary" : "OpenClaw Vulnerable to HTML injection via unvalidated image MIME type in data-URL interpolation",
"details" : "## 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",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N"
}, {
"type" : "CVSS_V4",
"score" : "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"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "openclaw"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2026.2.23"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/openclaw/openclaw/security/advisories/GHSA-2ww6-868g-2c56"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-32040"
}, {
"type" : "WEB",
"url" : "https://github.com/openclaw/openclaw/pull/24140"
}, {
"type" : "WEB",
"url" : "https://github.com/openclaw/openclaw/commit/f3adf142c195000cbde31200626a1d8c8b716df9"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/openclaw/openclaw"
}, {
"type" : "WEB",
"url" : "https://www.vulncheck.com/advisories/openclaw-html-injection-via-unvalidated-image-mime-type-in-data-url-interpolation"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2026-03-03T18:30:39Z",
"nvd_published_at" : "2026-03-19T22:16:40Z"
}
}