CVE-2026-26226: Beautiful mermaid Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-cgmm-x5ww-q5cr
CWE-79
Published
Advisory Summary

CVE-2026-26226 is a MODERATE cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Beautiful mermaid libraries in the npm ecosystem. The issue involves beautiful-mermaid contains an svg attribute injection issue that can lead to cross-site scripting (xss). Remediation is available by upgrading affected packages to version 0.1.3.

CVE-2026-26226 at a Glance

CVE Identifier CVE-2026-26226
GHSA Identifier GHSA-cgmm-x5ww-q5cr
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Beautiful mermaid
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2026-26226

To remediate this vulnerability, upgrade all affected Beautiful mermaid dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

beautiful-mermaid fixed: 0.1.3
npm install beautiful-mermaid@0.1.3
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 beautiful-mermaid

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-26226, inspect your project dependencies using npm:

npm ls beautiful-mermaid

Analyze the terminal output to locate any version of Beautiful mermaid in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.1.3), your application is affected.

Note: The npm ls beautiful-mermaid 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 Beautiful mermaid, 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

beautiful-mermaid versions prior to 0.1.3 contain an SVG attribute injection issue that can lead to cross-site scripting (XSS) when rendering attacker-controlled Mermaid diagrams. User-controlled values from Mermaid style and classDef directives are interpolated into SVG attribute values without proper escaping, allowing crafted input to break out of an attribute context and inject arbitrary SVG elements/attributes into the rendered output. When the generated SVG is embedded in a web page, this can result in script execution in the context of the embedding origin.

CVE-2026-26226 Affected Beautiful mermaid Versions

1 component(s)
Fixed Versions:
0.1.3
Product / Package Ecosystem Affected Versions Fixed Version
beautiful-mermaid
npm
< 0.1.3
0.1.3

References

Frequently Asked Questions

What is CVE-2026-26226?
CVE-2026-26226 is a security vulnerability in Beautiful mermaid involving beautiful-mermaid contains an SVG attribute injection issue that can lead to cross-site scripting (XSS) under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Beautiful mermaid versions are affected?
Affected versions include releases prior to 0.1.3 across affected packages: beautiful-mermaid.
What version fixes CVE-2026-26226?
Upgrading to 0.1.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is beautiful-mermaid affected?
Yes, beautiful-mermaid is affected in releases prior to 0.1.3. Upgrade your dependency to 0.1.3 or later.
What CWE is associated with CVE-2026-26226?
CVE-2026-26226 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-26226?
Run the dependency tree command: 'npm ls beautiful-mermaid'. 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-cgmm-x5ww-q5cr",
  "modified" : "2026-02-13T21:04:19Z",
  "published" : "2026-02-13T18:31:25Z",
  "aliases" : [ "CVE-2026-26226" ],
  "summary" : "beautiful-mermaid contains an SVG attribute injection issue that can lead to cross-site scripting (XSS)",
  "details" : "beautiful-mermaid versions prior to 0.1.3 contain an SVG attribute injection issue that can lead to cross-site scripting (XSS) when rendering attacker-controlled Mermaid diagrams. User-controlled values from Mermaid style and classDef directives are interpolated into SVG attribute values without proper escaping, allowing crafted input to break out of an attribute context and inject arbitrary SVG elements/attributes into the rendered output. When the generated SVG is embedded in a web page, this can result in script execution in the context of the embedding origin.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "beautiful-mermaid"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.1.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-26226"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/lukilabs/beautiful-mermaid/pull/8"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/lukilabs/beautiful-mermaid/commit/68f3ab8c9658e7f4a3b749e06a6b96e4c3f55db1"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/lukilabs/beautiful-mermaid"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/lukilabs/beautiful-mermaid/releases/tag/v0.1.3"
  }, {
    "type" : "WEB",
    "url" : "https://neo.projectdiscovery.io/share/cec71dc7-a8eb-417e-b8b4-666644796c1e"
  }, {
    "type" : "WEB",
    "url" : "https://www.vulncheck.com/advisories/beautiful-mermaid-svg-attribute-injection"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-02-13T21:04:19Z",
    "nvd_published_at" : "2026-02-13T17:16:14Z"
  }
}