CVE-2026-32040: Openclaw OpenClaw Vulnerable To HTML Injection Vulnerability

LOW
Advisory Identifier: GHSA-2ww6-868g-2c56
CVSS 4.6
CWE-79
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2026-32040
GHSA Identifier GHSA-2ww6-868g-2c56
Severity LOW
CVSS v3.1 Base Score 4.6
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Openclaw
Package Ecosystem npm
Published Date
Last Updated

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).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (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.

openclaw fixed: 2026.2.23
npm install openclaw@2026.2.23
Verify Direct and Transitive Dependencies

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

## Summary 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. ## Impact 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. ## Affected components - `src/auto-reply/reply/export-html/template.js` — line 1032 (tool result images), line 1306 (user message images) ## Reproduction 1. Craft a session entry with an image content block where `mimeType` is set to `image/png" onerror="alert(document.domain)` 2. Export the session to HTML 3. Open the exported HTML — the injected `onerror` fires ## Remediation - Added `sanitizeImageMimeType()` helper that validates mimeType against a whitelist of known image MIME types - Falls back to `application/octet-stream` for unrecognized values, preventing attribute breakout ## Fix https://github.com/openclaw/openclaw/pull/24140

CVE-2026-32040 Affected Openclaw Versions

1 component(s)
Fixed Versions:
2026.2.23
Product / Package Ecosystem Affected Versions Fixed Version
openclaw
npm
< 2026.2.23
2026.2.23

References

Frequently Asked Questions

What is CVE-2026-32040?
CVE-2026-32040 is a security vulnerability in Openclaw involving OpenClaw Vulnerable to HTML injection via unvalidated image MIME type in data-URL interpolation under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Openclaw versions are affected?
Affected versions include releases prior to 2026.2.23 across affected packages: openclaw.
What version fixes CVE-2026-32040?
Upgrading to 2026.2.23 (or the latest patched release for your respective branch) resolves the vulnerability.
Is openclaw affected?
Yes, openclaw is affected in releases prior to 2026.2.23. Upgrade your dependency to 2026.2.23 or later.
What is the CVSS score of CVE-2026-32040?
CVE-2026-32040 has a CVSS v3.1 base score of 4.6 (LOW) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2026-32040?
CVE-2026-32040 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (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.).
How can I check npm dependencies for CVE-2026-32040?
Run the dependency tree command: 'npm ls openclaw'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}