fix(deps): update dependency mermaid to v10.9.8 [security] - #125
Open
renovate[bot] wants to merge 1 commit into
Open
renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
renovate
Bot
force-pushed
the
renovate/npm-mermaid-vulnerability
branch
from
August 22, 2025 22:54
1a7e952 to
d4f43e8
Compare
renovate
Bot
force-pushed
the
renovate/npm-mermaid-vulnerability
branch
2 times, most recently
from
March 30, 2026 17:51
d4f43e8 to
a800b6a
Compare
renovate
Bot
force-pushed
the
renovate/npm-mermaid-vulnerability
branch
2 times, most recently
from
April 28, 2026 05:08
a800b6a to
fe19a55
Compare
renovate
Bot
force-pushed
the
renovate/npm-mermaid-vulnerability
branch
2 times, most recently
from
May 18, 2026 15:10
fbb1de6 to
d8c1938
Compare
renovate
Bot
force-pushed
the
renovate/npm-mermaid-vulnerability
branch
from
May 28, 2026 18:42
d8c1938 to
64fa46c
Compare
renovate
Bot
force-pushed
the
renovate/npm-mermaid-vulnerability
branch
from
June 13, 2026 16:16
64fa46c to
6f479b4
Compare
renovate
Bot
force-pushed
the
renovate/npm-mermaid-vulnerability
branch
from
July 12, 2026 17:00
6f479b4 to
a4f8272
Compare
renovate
Bot
force-pushed
the
renovate/npm-mermaid-vulnerability
branch
from
August 11, 2026 23:53
a4f8272 to
20784d7
Compare
renovate
Bot
force-pushed
the
renovate/npm-mermaid-vulnerability
branch
from
August 26, 2026 18:06
20784d7 to
dfc36b8
Compare
renovate
Bot
force-pushed
the
renovate/npm-mermaid-vulnerability
branch
from
September 7, 2026 22:00
dfc36b8 to
bd4f843
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
10.9.1→10.9.8Mermaid improperly sanitizes sequence diagram labels leading to XSS
CVE-2025-54881 / GHSA-7rqq-prvp-x9jh
More information
Details
Summary
In the default configuration of mermaid 11.9.0, user supplied input for sequence diagram labels is passed to
innerHTMLduring calculation of element size, causing XSS.Details
Sequence diagram node labels with KaTeX delimiters are passed through
calculateMathMLDimensions. This method passes the full label toinnerHTMLwhich allows allows malicious users to inject arbitrary HTML and cause XSS when mermaid-js is used in it's default configuration (with KaTeX support enabled).The vulnerability lies here:
The
calculateMathMLDimensionsmethod was introduced in 5c69e5fdb004a6d0a2abe97e23d26e223a059832 two years ago, which was released in Mermaid 10.9.0.PoC
Render the following diagram and observe the modified DOM.
Here is a PoC on mermaid.live: https://mermaid.live/edit#pako:eNpVUMtOwzAQ_BWzyoFKaRTyaFILiio4IK7ckA-1km1iKbaLY6spUf4dJ0AF68uOZ2dm7REqXSNQ6PHDoarwWfDGcMkUudaJGysqceLKkj3hPdl3osJ7IRvSm-qBwcCAaIXGaONRrSsnUdnobITF28PQ954lwXglai25UNNhxWAXBMyXxcGOi-3kL_5k79e73atuFSUv2HWazH1IWn0m3CC5aPf4b3p2WK--BW-4DJCOWzQ3TM0HQmiMqIFa4zAEicZv4iGMsw0D26JEBtS3NR656ywDpiYv869_11r-Ko12TQv0yLveI3eqfcjP111HUNVonrRTFuhdsVgAHWEAmuRxlG7SuEzKMi-yJAnhAjTLIk_EcbFJtuk2y9MphM8lM47KIp--AOZghtU
Impact
XSS on all sites that use mermaid and render user supplied diagrams without further sanitization.
Remediation
The value of the
textargument for thecalculateMathMLDimensionsmethod needs to be sanitized before getting passed on toinnerHTML.Severity
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Mermaid: Improper sanitization of
classDefin state diagrams leads to HTML injectionCVE-2026-41149 / GHSA-ghcm-xqfw-q4vr
More information
Details
Impact
Under the default configuration, Mermaid state diagram's
classDefallow DOM injection that escapes the SVG, although<script>tags are removed, preventing XSS.Proof-of-concept
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:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:N/SC:L/SI:L/SA:LReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Mermaid: Improper sanitization of
classDefsin diagrams leads to CSS injectionCVE-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
classDefvalues with an unrestricted regex: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
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:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:N/SC:L/SI:L/SA:LReferences
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, andaltFontFamilyconfiguration options.Live demo: mermaid.live
Example code:
The injected CSS exploits stylis's
&(scope reference) handling.:not(&)escapes the#mermaid-xxxautomatic 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
secureconfig value in the mermaid config to avoid allowing diagrams to modifyfontFamily,themeCSS,altFontFamily, andthemeVariables.Setting
"securityLevel": "sandbox"will also prevent this.Credits
Reported by @zsxsoft on behalf of @KeenSecurityLab
Severity
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:N/SC:L/SI:L/SA:LReferences
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
excludesattribute to exclude all dates.Example:
mermaid.parseis unaffected, unless you then call theganttDb.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:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:L/SC:N/SI:N/SA:LReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Mermaid XY Charts are vulnerable to an infinite loop DoS
CVE-2026-71436 / GHSA-2v8p-3f2j-5mp7
More information
Details
Impact
Mermaid XY Charts are vulnerable to an infinite loop DoS attack in the
setXAxisRangeData(), when configuring an X-Axis with invalid parameters.As each loop appends an element to an array, this would generally only cause an
RangeError: Invalid array lengthto appear after a few seconds, but may cause the page/JavaScript process to crash due to memory exhaustion, depending on the environment.Proof-of-concept
Patches
This has been patched in mermaid-js/mermaid@630aa7e and released in Mermaid v11.16.1.
A backport has been made for the v10 branch in ef60adc837d9d5107af21285f01e83dea309bd0a and was released in Mermaid v10.9.8
Workarounds
There are no known workarounds. Please update to the latest version or apply the patch.
References
Severity
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:L/SC:N/SI:N/SA:LReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Mermaid configuration APIs allow prototype pollution
CVE-2026-71438 / GHSA-c4c3-pg64-4m4v
More information
Details
Summary
Mermaid's configuration setters (
mermaid.initialize,mermaidAPI.setConfig, andmermaidAPI.updateSiteConfig) merge the caller-supplied configuration object into Mermaid's internal config using theassignWithDepthdeep-merge helper that is vulnerable to prototype pollution.Because these APIs are intended to receive trusted configuration supplied by the application integrating Mermaid, Mermaid assesses the practical risk as low. The vulnerability is only reachable if an application forwards attacker-controlled data directly into one of these configuration entry points, which is outside their documented usage.
User-controlled configuration (e.g. configuration in diagram code using
%%{init: {}}%%or YAML frontmatter) are already protected from prototype pollution.Patches
This has been patched in mermaid-js/mermaid@2cd6dcf and released in Mermaid v11.16.1.
A backport has been made for the v10 branch in c34b07a0815842327e70794d69b0c8c5a1e2a956 and was released in Mermaid v10.9.8
Impact
Mermaid believes it's unlikely that anybody is impacted, as these functions are configuration entry points expected to receive trusted, developer-controlled values as they can modify other security-relevant configuration.
Workarounds
Don't pass user-controlled data to the
mermaid.initialize,mermaidAPI.setConfig, andmermaidAPI.updateSiteConfigfunctions. Instead, users can use%%{init: {}}%%or YAML frontmatter in diagrams.Reporters
Severity
CVSS:4.0/AV:L/AC:L/AT:P/PR:H/UI:A/VC:N/VI:L/VA:L/SC:H/SI:H/SA:HReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Mermaid allows CSS injection applying to sibling elements of the diagram
CVE-2026-50159 / GHSA-6x64-9x62-f2gx
More information
Details
Summary
Mermaid does not fully restrict CSS to the rendered SVG subtree. Although selectors are prefixed with
#mermaid-X, sibling (~and+) combinators can still escape the Mermaid container and inject styles to DOM elements adjacent to the diagram<svg>.Most users of mermaid would not be affected by this, as mermaid adds its
<svg>as an only child of it's parent element. However, you may be affected if you manually insert the<svg>(or other elements) into the DOM yourself.Details
Mermaid namespaces CSS through with a middleware intended to scope all rules to the diagram's SVG element. CSS nesting expands
& ~ * { ... }to#svgId ~ *, which selects all sibling elements following the SVG in the DOM, outside the diagram boundary.Impact
An attacker able to supply diagram source to a page (e.g., user-generated content rendered by Mermaid) could inject CSS rules affecting sibling elements to the diagram
<svg>on the host page. This can be used for UI redressing, hiding content, conditional CSS-based probing, or phishing-style visual manipulation.JavaScript execution is not possible via this vector.
Patches
This has been patched in mermaid-js/mermaid@12d472c and released in Mermaid v11.16.1.
A backport has been made for the v10 branch in 7e83f1533318b307764d961906a73377266f4c5e and was released in Mermaid v10.9.8
Workarounds
If you are inserting the
<svg>into the DOM yourself, you can wrap it in an element with no other children, e.g.<div><svg>...</svg></div>orelement.innerHTML = svg. Alternatively, you can usemermaid.run()ormermaid.initialize()which will do this for you.Setting "securityLevel": "sandbox" will also prevent this, or setting the
secureconfig value in the mermaid config to avoid allowing diagrams to modifyfontFamily,themeCSS,altFontFamily, andthemeVariables.To test, you can try using a
themeCSSwith& + * { /* my CSS here */}and see if it's applied outside of your mermaid<svg>.References
Severity
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:N/SC:L/SI:L/SA:LReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
mermaid-js/mermaid (mermaid)
v10.9.8Compare Source
Backports the following fixes from Mermaid v11.16.1.
mermaidAPI.setConfig()functionDue to a publish error, v10.9.7 was skipped.
Full Changelog: mermaid-js/mermaid@v10.9.6...v10.9.8
v10.9.6Compare Source
Backports the following security fixes from Mermaid v11.15.0:
a59ea56)8fead23)4e2d512)a9d9f0d)uuiddependency range to allow v14We don't use this vulnerable code, but it allows users to silence this warning.
(
e8c7043)And other dependency updates.
Full Changelog: mermaid-js/mermaid@v10.9.5...v10.9.6
v10.9.5Compare Source
This release backports the update of the dependency dagre-d3-es to 7.0.13 for CVE-2025-57347 from v11.12.1.
We've also updated the v10.x branch to support newer versions of DOMPurify, cherry-picked from
fe3cffb, avoiding CVE-2025-26791.Full Changelog: mermaid-js/mermaid@v10.9.4...v10.9.5
v10.9.4Compare Source
This release backports the fix for GHSA-7rqq-prvp-x9jh from v11.10.0, preventing a potential XSS attack in labels in sequence diagrams.
See:
9d68517(onmainbranch)See:
7509b06(backported commit)Full Changelog: mermaid-js/mermaid@v10.9.3...v10.9.4
v10.9.3Compare Source
Updates the bundled version of dependencies in the following files:
dist/mermaid.min.jsdist/mermaid.jsdist/mermaid.esm.mjsdist/mermaid.esm.min.mjsIf you are not using these files (e.g. you are using the default NPM export of
mermaid, e.g.import mermaid from 'mermaid', or you are usingdist/mermaid.core.mjs), this release is identical to v10.9.2.This is to avoid potential security issues in KaTeX and DOMPurify, see:
These dependencies have already been updated in v11.0.0.
Changelog
Chore
2bedd0e)92a07ff)Full Changelog: mermaid-js/mermaid@v10.9.2...v10.9.3
v10.9.2Compare Source
This release back-ports #5914 to the v10 release line to fix #5904 (an incompatibility between mermaid and DOMPurify v3.1.7)
Patch Changes
402abdf[10] fix: ban version v3.1.7 of DOMPurifyFull Changelog: mermaid-js/mermaid@v10.9.1...v10.9.2
Configuration
📅 Schedule: (UTC)
🚦 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.
This PR was generated by Mend Renovate. View the repository job log.