Skip to content
Heist/ feed
Back to feed
Medium

node-mermaid — security advisory

Type: advisorySources: OSVAdvisory ID: UBUNTU-CVE-2026-41148

Mermaid is a JavaScript tool that uses Markdown-inspired text to create and modify diagrams and charts. Versions 10.9.5 and prior, in addition to 11.0.0-alpha.1 through 11.12.0 are vulnerable to CSS injection through improper sanitization. The state diagram (and any other diagram type that routes user-controlled style strings through the createCssStyles parser) captures classDef values using an unrestricted regex that matches everything up to a newline. That value then flows unsanitized through addStyleClass() into createCssStyles() and is assigned to style.innerHTML, so a closing brace (}) in the value terminates the generated CSS selector and turns everything after it into a new CSS rule on the page. This enables page defacement, user tracking via url() callbacks, and DOM attribute exfiltration. This issue has been fixed in versions 10.9.6 and 11.15.0. If developers are unable to immediately upgrade, they can work around this issue by setting "securityLevel": "sandbox", which prevents the issue by rendering the mermaid diagram in a sandboxed .

Products
node-mermaid
Affected versions
8.13.3+ds+~cs26.13.21-1, 8.13.3+ds+~cs26.13.21-2, 8.13.8+~cs10.4.16-1, 8.7.0+ds+~cs27.17.17-3, 9.2.2+~2.0.0-1, 9.2.2+~2.0.0-2
Fixed versions
Not specified
CVEs
CVE-2026-41148
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 00:33 UTC · Revision 1

Source evidence

UBUNTU-CVE-2026-41148

core-osv · Original source

Published 22 May 2026, 23:16 UTC

Mermaid is a JavaScript tool that uses Markdown-inspired text to create and modify diagrams and charts. Versions 10.9.5 and prior, in addition to 11.0.0-alpha.1 through 11.12.0 are vulnerable to CSS injection through improper sanitization. The state diagram (and any other diagram type that routes user-controlled style strings through the createCssStyles parser) captures classDef values using an unrestricted regex that matches everything up to a newline. That value then flows unsanitized through addStyleClass() into createCssStyles() and is assigned to style.innerHTML, so a closing brace (}) in the value terminates the generated CSS selector and turns everything after it into a new CSS rule on the page. This enables page defacement, user tracking via url() callbacks, and DOM attribute exfiltration. This issue has been fixed in versions 10.9.6 and 11.15.0. If developers are unable to immediately upgrade, they can work around this issue by setting "securityLevel": "sandbox", which prevents the issue by rendering the mermaid diagram in a sandboxed .

osv:UBUNTU-CVE-2026-41148

node-mermaid

Fixed versions: Not specified

node-mermaid

Fixed versions: Not specified

Complete source record
{
  "id": "d0561f37b0564a203aaa555fcd5545c3b00ea8b49fce09a7aad7c8d04c37033c",
  "url": "https://osv.dev/vulnerability/UBUNTU-CVE-2026-41148",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "UBUNTU-CVE-2026-41148",
    "summary": "Mermaid is a JavaScript tool that uses Markdown-inspired text to create and modify diagrams and charts. Versions 10.9.5 and prior, in addition to 11.0.0-alpha.1 through 11.12.0 are vulnerable to CSS injection through improper sanitization. The state diagram (and any other diagram type that routes user-controlled style strings through the createCssStyles parser) captures classDef values using an unrestricted regex that matches everything up to a newline. That value then flows unsanitized through addStyleClass() into createCssStyles() and is assigned to style.innerHTML, so a closing brace (}) in the value terminates the generated CSS selector and turns everything after it into a new CSS rule on the page. This enables page defacement, user tracking via url() callbacks, and DOM attribute exfiltration. This issue has been fixed in versions 10.9.6 and 11.15.0. If developers are unable to immediately upgrade, they can work around this issue by setting \"securityLevel\": \"sandbox\", which prevents the issue by rendering the mermaid diagram in a sandboxed .",
    "evidence": "osv:UBUNTU-CVE-2026-41148",
    "products": [
      {
        "name": {
          "value": "node-mermaid",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "8.7.0+ds+~cs27.17.17-3",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "8.13.3+ds+~cs26.13.21-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "8.13.3+ds+~cs26.13.21-2",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "8.13.8+~cs10.4.16-1",
            "evidence": "/affected/0/versions"
          }
        ]
      },
      {
        "name": {
          "value": "node-mermaid",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "9.2.2+~2.0.0-1",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "9.2.2+~2.0.0-2",
            "evidence": "/affected/1/versions"
          }
        ]
      }
    ],
    "severity": "medium",
    "structured": {
      "id": "UBUNTU-CVE-2026-41148",
      "aliases": [
        "UBUNTU-CVE-2026-41148"
      ],
      "metrics": [
        {
          "type": "CVSS_V4",
          "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:N/SC:L/SI:L/SA:L"
        },
        {
          "type": "Ubuntu",
          "score": "medium"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "node-mermaid",
            "purl": "pkg:deb/ubuntu/node-mermaid?arch=source&distro=jammy",
            "ecosystem": "Ubuntu:22.04:LTS"
          },
          "versions": [
            "8.7.0+ds+~cs27.17.17-3",
            "8.13.3+ds+~cs26.13.21-1",
            "8.13.3+ds+~cs26.13.21-2",
            "8.13.8+~cs10.4.16-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-41148.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "node-mermaid",
                "binary_version": "8.13.8+~cs10.4.16-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "node-mermaid",
            "purl": "pkg:deb/ubuntu/node-mermaid?arch=source&distro=stonking",
            "ecosystem": "Ubuntu:26.10"
          },
          "versions": [
            "9.2.2+~2.0.0-1",
            "9.2.2+~2.0.0-2"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-41148.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "node-mermaid",
                "binary_version": "9.2.2+~2.0.0-2"
              }
            ]
          }
        }
      ],
      "modified": "2026-10-17T12:55:43.030869951Z",
      "provider": "osv",
      "upstream": [
        "CVE-2026-41148"
      ],
      "references": [
        "https://ubuntu.com/security/CVE-2026-41148",
        "https://www.cve.org/CVERecord?id=CVE-2026-41148",
        "https://github.com/mermaid-js/mermaid/security/advisories/GHSA-xcj9-5m2h-648r",
        "https://github.com/mermaid-js/mermaid/commit/8fead23c59166b7bab6a39eac81acebee2859102",
        "https://github.com/mermaid-js/mermaid/commit/e9b0f34d8d82a6260077764ee45e1d7d90957a0f",
        "https://github.com/mermaid-js/mermaid/releases/tag/mermaid%4011.15.0",
        "https://github.com/mermaid-js/mermaid/releases/tag/v10.9.6",
        "https://mermaid.js.org/config/schema-docs/config.html#securitylevel"
      ]
    },
    "related_cves": [
      {
        "value": "CVE-2026-41148",
        "evidence": "/upstream"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 353987,
  "published_at": "2026-05-22T23:16:00+00:00"
}