Skip to content
Heist/ feed
Back to feed
Medium

node-mermaid — security advisory

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

Mermaid is a JavaScript tool that uses Markdown-inspired text to create and modify diagrams and charts. Prior to 10.9.6 and 11.15.0, Mermaid's default configuration allows injecting CSS that applies outside of the Mermaid diagram via the fontFamily, themeCSS, and altFontFamily configuration options. The injected CSS exploits stylis's & (scope reference) handling. :not(&) escapes the #mermaid-xxx automatic scoping, applying styles to all page elements. Global at-rules (@font-face, @keyframes, @counter-style) are also injectable as stylis hoists them to top level. This allows page defacement and DOM attribute exfiltration via CSS :has() selectors. This vulnerability is fixed in 10.9.6 and 11.15.0.

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-41159
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 00:33 UTC · Revision 1

Source evidence

UBUNTU-CVE-2026-41159

core-osv · Original source

Published 29 May 2026, 15:16 UTC

Mermaid is a JavaScript tool that uses Markdown-inspired text to create and modify diagrams and charts. Prior to 10.9.6 and 11.15.0, Mermaid's default configuration allows injecting CSS that applies outside of the Mermaid diagram via the fontFamily, themeCSS, and altFontFamily configuration options. The injected CSS exploits stylis's & (scope reference) handling. :not(&) escapes the #mermaid-xxx automatic scoping, applying styles to all page elements. Global at-rules (@font-face, @keyframes, @counter-style) are also injectable as stylis hoists them to top level. This allows page defacement and DOM attribute exfiltration via CSS :has() selectors. This vulnerability is fixed in 10.9.6 and 11.15.0.

osv:UBUNTU-CVE-2026-41159

node-mermaid

Fixed versions: Not specified

node-mermaid

Fixed versions: Not specified

Complete source record
{
  "id": "1333f07ef4e4581ba812a693439be58a6c14694979e12cc690f127c00b87f457",
  "url": "https://osv.dev/vulnerability/UBUNTU-CVE-2026-41159",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "UBUNTU-CVE-2026-41159",
    "summary": "Mermaid is a JavaScript tool that uses Markdown-inspired text to create and modify diagrams and charts. Prior to 10.9.6 and 11.15.0, Mermaid's default configuration allows injecting CSS that applies outside of the Mermaid diagram via the fontFamily, themeCSS, and altFontFamily configuration options. The injected CSS exploits stylis's & (scope reference) handling. :not(&) escapes the #mermaid-xxx automatic scoping, applying styles to all page elements. Global at-rules (@font-face, @keyframes, @counter-style) are also injectable as stylis hoists them to top level. This allows page defacement and DOM attribute exfiltration via CSS :has() selectors. This vulnerability is fixed in 10.9.6 and 11.15.0.",
    "evidence": "osv:UBUNTU-CVE-2026-41159",
    "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-41159",
      "aliases": [
        "UBUNTU-CVE-2026-41159"
      ],
      "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": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A: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-41159.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-41159.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "node-mermaid",
                "binary_version": "9.2.2+~2.0.0-2"
              }
            ]
          }
        }
      ],
      "modified": "2026-10-17T12:55:43.029302934Z",
      "provider": "osv",
      "upstream": [
        "CVE-2026-41159"
      ],
      "references": [
        "https://ubuntu.com/security/CVE-2026-41159",
        "https://www.cve.org/CVERecord?id=CVE-2026-41159",
        "https://github.com/mermaid-js/mermaid/security/advisories/GHSA-87f9-hvmw-gh4p",
        "https://github.com/mermaid-js/mermaid/commit/64769738d5b59211e1decb471ffbaca8afec51aa",
        "https://github.com/mermaid-js/mermaid/commit/a9d9f0d8eb790349121508688cd338253fd80d76",
        "https://github.com/mermaid-js/mermaid/commit/64769738d5b59211e1decb471ffbaca8afec51aahttps://github.com/mermaid-js/mermaid/commit/a9d9f0d8eb790349121508688cd338253fd80d76",
        "https://github.com/mermaid-js/mermaid/releases/tag/mermaid@11.15.0",
        "https://github.com/mermaid-js/mermaid/releases/tag/v10.9.6"
      ]
    },
    "related_cves": [
      {
        "value": "CVE-2026-41159",
        "evidence": "/upstream"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 353986,
  "published_at": "2026-05-29T15:16:00+00:00"
}