Skip to content

Release Candidate 11.16.1 - #8022

Merged
aloisklink merged 12 commits into
masterfrom
release/11.16.1
Aug 4, 2026
Merged

aloisklink merged 12 commits into
masterfrom
release/11.16.1

Conversation

@aloisklink

Copy link
Copy Markdown
Member

📑 Summary

Adds security fixes for the following issues:

Additionally, we are deprecating the mermaidAPI.setConfig() function, since it currently doesn't do anything useful.

📏 Design Decisions

N/A

📋 Tasks

Make sure you

  • 📖 have read the contribution guidelines
  • 💻 have added necessary unit/e2e tests.
  • 📓 have added documentation. Make sure MERMAID_RELEASE_VERSION is used for all new features.
  • 🦋 If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

aloisklink and others added 12 commits July 31, 2026 20:00
Brings the live-editing in the example.html from the `develop` branch
into the `release/10.9.7` branch, since it makes it much easier to
backport fixes.

Adapted-from: 0ff3ba3
Adapted-from: 5661509
Adapted-from: f135a3a
Currently, if you have a broken diagram when using `dev/example.html`,
then refresh the page, the page breaks.

Changing the `await render()` to happen after the event listeners are
setup fixes this.
This gets us out of quirks mode and uses proper HTML mode.
Conflicts:
- demos/dev/example.html (added the elk layout)
- demos/index.html
This adds some improvements to `demos/dev/example.html` (e.g. error
handling, showing errors, and timing info) that make it easier to test
mermaid locally.
* fix(architecture): handle arbitrary prototype pollution

Update the `ArchitectureGroupAlignments` to use a
`Map<`${string}-${string},` instead of being a
`Record<string, Record<string,`. Not only does this make the code
simpler, but it also means we avoid arbritary prototype pollution
attacks.

Fixes: GHSA-3rrr-jr9j-h3q3
Fixes: cb0a470

* refactor(architecture): use `Map` for registeredIds

* fix(architecture): improve group ID handling

`__proto__`, `constructor`, `toString`, etc. can now be used as a group ID in
architecture diagrams.

* refactor(architecture): use Map for nodes in DB

* refactor(architecture): use Map for spatial maps

* refactor(architecture): use `Set` for visit record

* refactor(architecture): use Map for `adjList`

* refactor(architecture): use Map for elements storage

* refactor(architecture): use Map for alignments

* test(architecture): test for service ID sorting

The old code sorted services by their ID using object iteration order,
which would sort numeric keys before string keys.

Now they are sorted in insertion order, so you can change around the
order of `service` statements in your diagram.

* test(architecture): test for GHSA-3rrr-jr9j-h3q3

Add a modified test to confirm that the prototype pollution in
GHSA-3rrr-jr9j-h3q3 is no longer exploitable.
The current radar diagram renderer adds a very ugly gradient to radar
diagrams, even if the number of ticks goes above 30.

Because of that, I used 32 as the maximum number of ticks, as anything
higher than that doesn't seem to be useable.

Just in case people are using a higher number (e.g. accidentally), I've
made this only a soft warning, and will continue rendering a radar
diagram over the limit, just with 32 ticks instead.

Fixes: GHSA-rhh3-jpg6-66xh
* fix(xyChart): fix incorrect spacing, added e2e-test

Cherry-picked-from: 46fe731

* fix(xychart): support zero-width x-axis ranges

Add support for an x-axis range that has zero-width, e.g.

```
xychart-beta
  x-axis 0 --> 0
  line [1, 2]
```

This also fixes floating-point rounding issues for very large ranges.

Fixes: GHSA-2v8p-3f2j-5mp7

---------

Co-authored-by: OG-NI <in.neu@online.de>
* refactor: remove unused `clobber` from `assignWithDepth`

* docs: improve `assignWithDepth` documentation

Fixes the formatting of the `assignWithDepth` function's TSDoc.

* fix: refactor `assignWithDepth`

This makes it prototype pollution resistant, and it also handles `null`
values like `undefined`. Additionally, I've got rid of more of the `any`
types, so it's slightly safer.

Fixes: GHSA-c4c3-pg64-4m4v

* deprecate: deprecate public `setConfig` function

Deprecate the existing `mermaidAPI.setConfig()` function.

Calling this function has no observable effect, as the next time a
`render()` or `parse()` is called, the `currentConfig` is cleared.

* docs: rewrite config function doc comments

The function documentation comments in `config.ts` are still using the
old pre-typedoc [`documentation`][1] strings.

[1]: https://www.npmjs.com/package/documentation

* refactor: stop exporting `updateCurrentConfig`

This function is only ever exported for one unit test, but since it's
exported from this file, it shows up in
<https://mermaid.js.org/config/setup/config/README.html> unnecessarily,
since it's not exposed anywhere as part of the public mermaid API.

* test: test and doc assignWithDepth pollution fix
Stylis compiles `& ~ *` and `& + *` to `#svgId ~ *` / `#svgId + *`,
which select DOM siblings of the SVG element (aka outside of the SVG
boundary).

This commit changes the `addNamespace` middleware to detect when a
selector uses one of these, and namespaces it properly, e.g.
`#svgId ~ *` into `#svgId #svgId ~ *`.

I've also added support for handling the [column combinator `||`][1].
It's experimental, but there's no reason not to handle it.

For `& {`, I had to do some special handling. Technically, it's not
namespaced, but namespacing it with `& &` breaks, and replacing it with
`& > *` overwrites some SVG presentation attributes, so it breaks
existing diagrams. Instead, I've just added a quick check that allows it
if-and-only-if it only has `font-family`, `font-size`, or `fill` rules.

[1]: https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Selectors/Column_combinator

Reported-by: h3ri0s <rohitprasanth8@gmail.com>
See: https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Selectors/Next-sibling_combinator
See: https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Selectors/Subsequent-sibling_combinator
Fixes: 6476973
We used squash merges, so the original commit IDs no longer exist.
@changeset-bot

changeset-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: eba7287

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
mermaid Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b8e02119-e38f-4696-b567-13a5246ffe3f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Aug 4, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.26415% with 27 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.30%. Comparing base (5a8eae7) to head (eba7287).
⚠️ Report is 15 commits behind head on master.

Files with missing lines Patch % Lines
.../src/diagrams/architecture/architectureRenderer.ts 70.37% 16 Missing ⚠️
...ermaid/src/diagrams/architecture/architectureDb.ts 88.75% 9 Missing ⚠️
packages/mermaid/src/diagrams/xychart/xychartDb.ts 60.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8022      +/-   ##
==========================================
+ Coverage   64.25%   64.30%   +0.05%     
==========================================
  Files         670      670              
  Lines       75010    75072      +62     
  Branches    11149    11171      +22     
==========================================
+ Hits        48195    48273      +78     
+ Misses      26815    26799      -16     
Flag Coverage Δ
unit 64.30% <87.26%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/mermaid/src/assignWithDepth.ts 100.00% <100.00%> (ø)
packages/mermaid/src/config.ts 92.85% <100.00%> (+2.78%) ⬆️
...aid/src/diagrams/architecture/architectureTypes.ts 80.99% <100.00%> (+5.77%) ⬆️
packages/mermaid/src/diagrams/radar/db.ts 96.90% <100.00%> (+0.24%) ⬆️
packages/mermaid/src/mermaidAPI.ts 87.53% <100.00%> (+0.64%) ⬆️
packages/mermaid/src/styles.ts 100.00% <100.00%> (ø)
packages/mermaid/src/diagrams/xychart/xychartDb.ts 90.62% <60.00%> (-1.57%) ⬇️
...ermaid/src/diagrams/architecture/architectureDb.ts 85.34% <88.75%> (+2.61%) ⬆️
.../src/diagrams/architecture/architectureRenderer.ts 77.49% <70.37%> (+0.77%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@argos-ci

argos-ci Bot commented Aug 4, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) 👍 Approved by Alois Klink 2 changed, 1 added Aug 4, 2026, 2:31 PM

@aloisklink
aloisklink merged commit acc69f1 into master Aug 4, 2026
30 of 31 checks passed
@aloisklink
aloisklink deleted the release/11.16.1 branch August 4, 2026 14:33
@github-actions github-actions Bot mentioned this pull request Aug 4, 2026
ark-65 added a commit to zhongmiao-org/mermaid-markdown-bridge that referenced this pull request Aug 5, 2026
Upstream release: https://github.com/mermaid-js/mermaid/releases/tag/mermaid%4011.16.1

Release notes:
### Patch Changes

-   [#8022](mermaid-js/mermaid#8022) [`12d472c`](mermaid-js/mermaid@12d472c) Thanks [@aloisklink](https://github.com/aloisklink)! - fix: handle CSS sibling combinators in compileCSS

-   [#8022](mermaid-js/mermaid#8022) [`2cd6dcf`](mermaid-js/mermaid@2cd6dcf) Thanks [@aloisklink](https://github.com/aloisklink)! - fix: increase protections against prototype pollution

    User-controlled input already has protections against prototype pollution.

    Fixes: GHSA-c4c3-pg64-4m4v

-   [#8022](mermaid-js/mermaid#8022) [`99af3fc`](mermaid-js/mermaid@99af3fc) Thanks [@aloisklink](https://github.com/aloisklink)! - fix(architecture): use `Map`s and `Set`s to store groups/services

    Services are now rendered in the order they are defined and more service IDs
    are now supported.

-   [#8022](mermaid-js/mermaid#8022) [`2cd6dcf`](mermaid-js/mermaid@2cd6dcf) Thanks [@aloisklink](https://github.com/aloisklink)! - deprecate: Deprecate the `mermaidAPI.setConfig()` function

    Calling this function has no observable effect, as the next time a
    `render()` or `parse()` is called, the `currentConfig` is cleared.

-   [#8022](mermaid-js/mermaid#8022) [`630aa7e`](mermaid-js/mermaid@630aa7e) Thanks [@aloisklink](https://github.com/aloisklink)! - fix(xychart): support zero-width x-axis ranges

-   [#8022](mermaid-js/mermaid#8022) [`59b22fa`](mermaid-js/mermaid@59b22fa) Thanks [@aloisklink](https://github.com/aloisklink)! - fix(radar): limit number of ticks to 32

    Setting a ticks value higher than this would only show 32 ticks.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: give me a 98K <240642031+inhuman-0@users.noreply.github.com>
Sign up for free to 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