Skip to content

Fix/doc site mermaid - #109

Merged
fredbi merged 4 commits into
go-openapi:masterfrom
fredbi:fix/doc-site-mermaid
Aug 14, 2026
Merged

Fix/doc site mermaid#109
fredbi merged 4 commits into
go-openapi:masterfrom
fredbi:fix/doc-site-mermaid

Conversation

@fredbi

@fredbi fredbi commented Aug 14, 2026

Copy link
Copy Markdown
Member

Change type

Please select: 🆕 New feature or enhancement|🔧 Bug fix'|📃 Documentation update

Short description

Fixes

Full description

Checklist

  • I have signed all my commits with my name and email (see DCO. This does not require a PGP-signed commit
  • I have rebased and squashed my work, so only one commit remains
  • I have added tests to cover my changes.
  • I have properly enriched go doc comments in code.
  • I have properly documented any breaking change.

@fredbi
fredbi force-pushed the fix/doc-site-mermaid branch from 96fb5dd to 4a0bfa5 Compare August 14, 2026 15:42
fredbi and others added 4 commits August 14, 2026 18:37
The rendered diagram is assigned with innerHTML, and Mermaid was
initialized with securityLevel 'loose' — which is precisely the setting
that turns off the sanitizer Mermaid otherwise runs over the SVG it hands
back, and allows HTML labels and click bindings in the diagram source. A
grammar production is repo-authored, so nothing here was reachable from
outside, but the diagrams carry no HTML labels and render identically under
'strict': the same seven diagrams on the grammar page come back byte for
byte unchanged.

The two error paths built their markup by concatenating a renderer message
into innerHTML. That message is the one string on this path we do not
author; it now goes through textContent, and the sink is gone with it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
11.16.0 is subject to five published advisories, all fixed in this patch
release: prototype pollution through the configuration APIs
(GHSA-c4c3-pg64-4m4v) and through architecture diagrams
(GHSA-3rrr-jr9j-h3q3), CSS injection reaching elements beside the diagram
(GHSA-6x64-9x62-f2gx), and two denial-of-service loops in the xychart and
radar renderers (GHSA-2v8p-3f2j-5mp7, GHSA-rhh3-jpg6-66xh).

Mermaid is vendored for the railroad shortcode and served from our own
static tree, so it is javascript we ship. The railroad diagrams render
unchanged on the patch release.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
The Relearn theme and Mermaid are fetched at build time and end up as
javascript served to every visitor of the site, and both were taken on
trust. They are now fetched with -f, over https with no downgrade, and
checked against a recorded sha256 before anything is unpacked.

The missing -f was a bug on its own: curl wrote the body of an HTTP error
response to mermaid.min.js and the build carried on, publishing a page
whose diagrams could never render.

A failing check is not necessarily an attack — the version and its digest
move together, and the command to recompute one is in the step.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
The line was written with innerHTML around values the worker sends back —
an exit code and the definition names read out of the scanned module.
Neither is markup, and neither is ours: the probe scans whatever module it
is pointed at. It is assembled with createElement and textContent now, so
there is no HTML parser on that path at all.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
@fredbi
fredbi force-pushed the fix/doc-site-mermaid branch from 4a0bfa5 to 91d6f4d Compare August 14, 2026 16:37
@fredbi
fredbi merged commit b8ad2f4 into go-openapi:master Aug 14, 2026
30 checks passed
@fredbi
fredbi deleted the fix/doc-site-mermaid branch August 14, 2026 16:54
@fredbi
fredbi restored the fix/doc-site-mermaid branch August 14, 2026 20:36
@fredbi
fredbi deleted the fix/doc-site-mermaid branch August 14, 2026 20:37
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