Skip to content

chore(deps): update dependency mermaid to v11.15.0 [security] - #235

Merged
edelauna merged 1 commit into
mainfrom
renovate/npm-mermaid-vulnerability
May 30, 2026
Merged

chore(deps): update dependency mermaid to v11.15.0 [security]#235
edelauna merged 1 commit into
mainfrom
renovate/npm-mermaid-vulnerability

Conversation

@renovate

@renovaterenovateBot commented May 21, 2026

Copy link
Copy Markdown
Contributor

ℹ️ Note

This PR body was truncated due to platform limits.

This PR contains the following updates:

PackageChangeAgeConfidence
mermaid11.10.011.15.0ageconfidence

Mermaid: Improper sanitization of classDef in state diagrams leads to HTML injection

CVE-2026-41149 / GHSA-ghcm-xqfw-q4vr

More information

Details

Impact

Under the default configuration, Mermaid state diagram's classDef allow DOM injection that escapes the SVG, although <script> tags are removed, preventing XSS.

Proof-of-concept
stateDiagram-v2
classDef xss fill:red</style></svg><style>*{x:x;y:y;overflow:visible!important;contain:none!important;transform:none!important;filter:none!important;clip-path:none!important}</style><div style="x:x;y:y;color:red;font:5em/1 monospace;display:grid;place-items:center;z-index:2147483647;width:100vw;height:100vh;position:fixed;top:0;left:0;background:black">HACKED</div><svg><style>a:b
[*] --> A:::xss
Patches
Workarounds

If you can not update to a patched version, setting "securityLevel": "sandbox" will prevent this, by rendering the mermaid diagram in a sandboxed <iframe>.

Credits

Thanks to @​zsxsoft from @​KeenSecurityLab for reporting this vulnerability.

Severity

  • CVSS Score: 5.3 / 10 (Medium)
  • Vector String: 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

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Mermaid: Improper sanitization of classDefs in diagrams leads to CSS injection

CVE-2026-41148 / GHSA-xcj9-5m2h-648r

More information

Details

Details

The state diagram and any other diagram type that routes user-controlled style strings through createCssStyles parser for Mermaid v11.14.0 and earlier captures classDef values with an unrestricted regex:

// packages/mermaid/src/diagrams/state/parser/stateDiagram.jison:83
<CLASSDEFID>[^\n]* { this.popState(); return 'CLASSDEF_STYLEOPTS' }

The value passes unsanitized through addStyleClass() -> createCssStyles() -> style.innerHTML (mermaidAPI.ts:418). A } in the value closes the generated CSS selector, and everything after becomes a new CSS rule on the page.

PoC
stateDiagram-v2 classDef x }*{ background-image: url("http://media.giphy.com/media/SggILpMXO7Xt6/giphy.gif")}

Live demo:
https://mermaid.live/edit#pako:eNpFjzFvgzAQhf-KdVNbEcBgMHhtlkqtOnSJKi8ONsYKBmRMlRTx3-skanvTfbp7996t0IxSAYPZC6_2Rmgn7O4rQ00v5nmvWnRG29OKjqI5aTcug9wZK7RiaHH9A4fO-4kliVXSiFibqbvEzWjvnHxo_fI6vR3e6cGXyX2qTcvhcYMItDMSmHeLisAqZ8UVYeUDQhx8p6ziwEIrhTtx4MNVM4nhcxztrywE0h2wVvRzoGWS_z_8rahBKvcckntgmN5OAFvhDIzUNCZZQXCR5nVaZkUEF2BVFpOcEkoxxhUuyRbB980yjStapKHqoKFlhvPtB7BFZEU

Patches

This has been patched in:

Workarounds

Setting "securityLevel": "sandbox" will prevent this, by rendering the mermaid diagram in a sandboxed <iframe>.

Impact

Enables page defacement, user tracking via url() callbacks, and DOM attribute exfiltration via CSS :has() selectors.

Severity

  • CVSS Score: 5.3 / 10 (Medium)
  • Vector String: 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

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Mermaid Gantt Charts are vulnerable to an Infinite Loop DoS

CVE-2026-41150 / GHSA-6m6c-36f7-fhxh

More information

Details

Impact

Mermaid v11.14.0 and earlier are vulnerable to a denial-of-service attack when rendering gantt charts, if they use the excludes attribute to exclude all dates.

Example:

gantt
excludes monday,tuesday,wednesday,thursday,friday,saturday,sunday
DoS :2025-01-01, 1d

mermaid.parse is unaffected, unless you then call the ganttDb.getTasks() (which is called when rendering a diagram).

Patches

This has been patched in:

Workarounds

There are no workarounds available without updating to a newer version of mermaid.

Severity

  • CVSS Score: 5.3 / 10 (Medium)
  • Vector String: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:L/SC:N/SI:N/SA:L

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Mermaid: Improper sanitization of configuration leads to CSS injection

CVE-2026-41159 / GHSA-87f9-hvmw-gh4p

More information

Details

Impact

Mermaid's default configuration allows injecting CSS that applies outside of the Mermaid diagram via the fontFamily, themeCSS, and altFontFamily configuration options.

Live demo: mermaid.live

Example code:

%%{init: {"fontFamily": "x;a{b} :not(&){background:green !important} c{d}"}}%%
flowchart LR
A --> B

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.

Patches
Workarounds

If you can't upgrade mermaid, you can set the secure config value in the mermaid config to avoid allowing diagrams to modify fontFamily, themeCSS, altFontFamily, and themeVariables.

Setting "securityLevel": "sandbox" will also prevent this.

Credits

Reported by @​zsxsoft on behalf of @​KeenSecurityLab

Severity

  • CVSS Score: 5.3 / 10 (Medium)
  • Vector String: 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

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Release Notes

mermaid-js/mermaid (mermaid)

v11.15.0

Compare Source

Minor Changes
  • #​71740aca217 Thanks @​milesspencer35! - feat(sequence): Add support for decimal start and increment values in the autonumber directive

  • #​75128e17492 Thanks @​aruncveli! - feat(flowchart): add datastore shape

    In Data flow diagrams, a datastore/warehouse/file/database is used to represent data persistence. It is denoted by a rectangle with only top and bottom borders, and can be used in flowcharts with A@{ shape: datastore, label: "Datastore" }.

  • #​64409ad8dde Thanks @​yordis, @​lgazo! - feat: add Event Modeling diagram

  • #​770727db774 Thanks @​txmxthy! - feat(architecture): expose four fcose layout knobs for architecture-beta diagrams (nodeSeparation, idealEdgeLengthMultiplier, edgeElasticity, numIter) so authors can tune layout density and spread overlapping siblings without changing diagram source

  • #​7604bf9502f Thanks @​M-a-c! - feat(class): add nested namespace support for class diagrams via dot notation and syntactic nesting

    If you have namespaces in class diagrams that use .s already and want to render them without nesting (≤v11.14.0 behaviour), you can use set class.hierarchicalNamespaces=false in your mermaid config:

    config:
    class:
    hierarchicalNamespaces: false
  • #​727288cdd3d Thanks @​xinbenlv! - feat(sankey): add outlined label style, configurable nodeWidth/nodePadding, and custom node colors

Patch Changes

v11.14.0

Compare Source

Thanks to our awesome mermaid community that contributed to this release: @​ashishjain0512, @​tractorjuice, @​autofix-ci[bot], @​aloisklink, @​knsv, @​kibanana, @​chandershekhar22, @​khalil, @​ytatsuno, @​sidharthv96, @​github-actions[bot], @​dripcoding, @​knsv-bot, @​jeroensmink98, @​Alex9583, @​GhassenS, @​omkarht, @​darshanr0107, @​leentaylor, @​lee-treehouse, @​veeceey, @​turntrout, @​Mermaid-Chart, @​BambioGaming, Claude

Releases

@​mermaid-js/examples@​1.2.0

Minor Changes

mermaid@​11.14.0

Minor Changes
  • #​7526efe218a - Add Wardley Maps diagram type (beta)

    Adds Wardley Maps as a new diagram type to Mermaid (available as wardley-beta). Wardley Maps are visual representations of business strategy that help map value chains and component evolution.

    Features:

    • Component positioning with [visibility, evolution] coordinates (OWM format)
    • Anchors for users/customers
    • Multiple link types: dependencies, flows, labeled links
    • Evolution arrows and trend indicators
    • Custom evolution stages with optional dual labels
    • Custom stage widths using @​boundary notation
    • Pipeline components with visibility inheritance
    • Annotations, notes, and visual elements
    • Source strategy markers: build, buy, outsource, market
    • Inertia indicators
    • Theme integration

    Implementation includes parser, D3.js renderer, unit tests, E2E tests, and comprehensive documentation.

  • #​7526efe218a - feat: implement neo look styling for state diagrams

  • #​7526efe218a - feat: implement neo look support for sequence diagrams with drop shadows, and enhanced styling

  • #​7526efe218a - feat: add randomize config option for architecture diagrams, defaulting to false for deterministic layout

  • #​7526efe218a - feat: Add option to change timeline direction

  • #​7526efe218a - Fix duplicate SVG element IDs when rendering multiple diagrams on the same page. Internal element IDs (nodes, edges, markers, clusters) are now prefixed with the diagram's SVG element ID across all diagram types. Custom CSS or JS using exact ID selectors like #arrowhead should use attribute-ending selectors like [id$="-arrowhead"] instead.

  • #​7526efe218a - feat: implement neo look styling for ER diagrams

  • #​7526efe218a - feat: implement neo look styling for requirement diagrams

  • #​7526efe218a - feat: add theme support for data label colour in xy chart

  • #​7526efe218a - feat: implement neo look styling for mindmap diagrams

  • #​7526efe218a - feat: implement neo look for mermaid flowchart diagrams

  • #​7526efe218a - feat: implement neo look and themes for class diagram

  • #​7526efe218a - feat: add showDataLabelOutsideBar option for xy chart

  • #​7526efe218a - feat: implement neo look support for timeline diagram with drop shadows, additoinal redux themes and enhanced styling

  • #​7526efe218a - feat: implement neo look and themes for gitGraph diagram

  • #​7526efe218a - add new TreeView diagram

Patch Changes
  • #​7526efe218a - add link to ishikawa diagram on mermaid.js.org

  • #​7526efe218a - docs: document valid duration token formats in gantt.md

  • #​7526efe218a - fix: ER diagram parsing when using "1" as entity identifier on right side

    The parser was incorrectly tokenizing the second "1" in patterns like a many to 1 1: because the lookahead rule only checked for alphabetic characters after whitespace, not digits. Added a new lookahead pattern "1"(?=\s+[0-9]) to correctly identify the cardinality alias before a numeric entity name.

    Fixes #​7472

  • #​7526efe218a - fix: scope cytoscape label style mapping to edges with labels to prevent console warnings

  • #​7526efe218a - fix: support inline annotation syntax in class diagrams (class Shape <>)

  • #​7526efe218a - fix: Align branch label background with text for multi-line labels in LR GitGraph layout

  • #​7526efe218a - fix: preserve cause hierarchy when ishikawa effect is indented more than causes

  • #​7526efe218a - refactor: remove unused createGraphWithElements function and add regression test for open edge arrowheads

  • #​7526efe218a - fix: Prevent long pie chart titles from being clipped by expanding the viewBox

  • #​7526efe218a - fix: prevent sequence diagram hang when "as" is used without a trailing space in participant declarations

  • #​7526efe218a - fix: warn when style statement targets a non-existent node in flowcharts

  • #​7526efe218a - fix: group state diagram SVG children under single root element

  • #​7526efe218a - fix: Allow :::className syntax inside composite state blocks

  • #​7526efe218a Thanks @​aloisklink, @​BambioGaming! - fix: prevent escaping < and & when htmlLabels: false

  • #​7526efe218a - fix: treemap title and labels use theme-aware colors for dark backgrounds

  • Updated dependencies [efe218a]:

@​mermaid-js/parser@​1.1.0

Minor Changes

@​mermaid-js/tiny@​11.14.0

Minor Changes
  • #​7526efe218a - Add Wardley Maps diagram type (beta)

    Adds Wardley Maps as a new diagram type to Mermaid (available as wardley-beta). Wardley Maps are visual representations of business strategy that help map value chains and component evolution.

    Features:

    • Component positioning with [visibility, evolution] coordinates (OWM format)
    • Anchors for users/customers
    • Multiple link types: dependencies, flows, labeled links
    • Evolution arrows and trend indicators
    • Custom evolution stages with optional dual labels
    • Custom stage widths using @​boundary notation
    • Pipeline components with visibility inheritance
    • Annotations, notes, and visual elements
    • Source strategy markers: build, buy, outsource, market
    • Inertia indicators
    • Theme integration

    Implementation includes parser, D3.js renderer, unit tests, E2E tests, and comprehensive documentation.

  • #​7526efe218a - feat: implement neo look styling for state diagrams

  • #​7526efe218a - feat: implement neo look support for sequence diagrams with drop shadows, and enhanced styling

  • #​7526efe218a - feat: add randomize config option for architecture diagrams, defaulting to false for deterministic layout

  • #​7526efe218a - feat: Add option to change timeline direction

  • #​7526efe218a - Fix duplicate SVG element IDs when rendering multiple diagrams on the same page. Internal element IDs (nodes, edges, markers, clusters) are now prefixed with the diagram's SVG element ID across all diagram types. Custom CSS or JS using exact ID selectors like #arrowhead should use attribute-ending selectors like [id$="-arrowhead"] instead.

  • #​7526efe218a - feat: implement neo look styling for ER diagrams

  • #​7526efe218a - feat: implement neo look styling for requirement diagrams

  • #​7526efe218a - feat: add theme support for data label colour in xy chart

  • #​7526efe218a - feat: implement neo look styling for mindmap diagrams

  • #​7526efe218a - feat: implement neo look for mermaid flowchart diagrams

  • #​7526efe218a - feat: implement neo look and themes for class diagram

  • #​7526efe218a - feat: add showDataLabelOutsideBar option for xy chart

  • #​7526efe218a - feat: implement neo look support for timeline diagram with drop shadows, additoinal redux themes and enhanced styling

  • #​7526efe218a - feat: implement neo look and themes for gitGraph diagram

  • #​7526efe218a - add new TreeView diagram

Patch Changes
  • #​7526efe218a - add link to ishikawa diagram on mermaid.js.org

  • #​7526efe218a - docs: document valid duration token formats in gantt.md

  • #​7526efe218a - fix: ER diagram parsing when using "1" as entity identifier on right side

    The parser was incorrectly tokenizing the second "1" in patterns like a many to 1 1: because the lookahead rule only checked for alphabetic characters after whitespace, not digits. Added a new lookahead pattern "1"(?=\s+[0-9]) to correctly identify the cardinality alias before a numeric entity name.

    Fixes #​7472

  • #​7526efe218a - fix: scope cytoscape label style mapping to edges with labels to prevent console warnings

  • #​7526efe218a - fix: support inline annotation syntax in class diagrams (class Shape <>)

  • #​7526efe218a - fix: Align branch label background with text for multi-line labels in LR GitGraph layout

  • #​7526efe218a - fix: preserve cause hierarchy when ishikawa effect is indented more than causes

  • #​7526efe218a - refactor: remove unused createGraphWithElements function and add regression test for open edge arrowheads

  • #​7526efe218a - fix: Prevent long pie chart titles from being clipped by expanding the viewBox

  • #​7526efe218a - fix: prevent sequence diagram hang when "as" is used without a trailing space in participant declarations

  • #​7526efe218a - fix: warn when style statement targets a non-existent node in flowcharts

  • #​7526efe218a - fix: group state diagram SVG children under single root element

  • #​7526efe218a - fix: Allow :::className syntax inside composite state blocks

  • #​7526efe218a Thanks @​aloisklink, @​BambioGaming! - fix: prevent escaping < and & when htmlLabels: false

  • #​7526efe218a - fix: treemap title and labels use theme-aware colors for dark backgrounds

  • Updated dependencies [efe218a]:

v11.13.0

Compare Source

Minor Changes
Patch Changes

Note

PR body was truncated to here.


Configuration

📅 Schedule: (in timezone America/Los_Angeles)

  • Branch creation
    • ""
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@codecov

codecovBot commented May 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@renovaterenovateBot changed the title Update dependency mermaid to v11.15.0 [SECURITY]chore(deps): update dependency mermaid to v11.15.0 [security]May 21, 2026
@renovaterenovateBot changed the title chore(deps): update dependency mermaid to v11.15.0 [security]Update dependency mermaid to v11.15.0 [SECURITY]May 22, 2026
@renovaterenovateBot changed the title Update dependency mermaid to v11.15.0 [SECURITY]chore(deps): update dependency mermaid to v11.15.0 [security]May 23, 2026
@renovate
renovateBotforce-pushed the renovate/npm-mermaid-vulnerability branch 4 times, most recently from 013fedb to 87377a6CompareMay 28, 2026 17:25
edelauna
edelauna previously approved these changes May 29, 2026

@edelaunaedelauna left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested mermaid rendering works:

Image

@edelauna
edelauna added this pull request to the merge queueMay 29, 2026
@github-merge-queue
github-merge-queueBot removed this pull request from the merge queue due to a conflict with the base branch May 29, 2026
@renovate
renovateBotforce-pushed the renovate/npm-mermaid-vulnerability branch from 87377a6 to d521ed9CompareMay 29, 2026 21:08
@edelauna
edelauna added this pull request to the merge queueMay 30, 2026
Merged via the queue into main with commit 2e03aeaMay 30, 2026
9 checks passed
@edelauna
edelauna deleted the renovate/npm-mermaid-vulnerability branch May 30, 2026 02:39
@edelaunaedelauna mentioned this pull request Jun 5, 2026
7 tasks
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@edelauna