Context
The operator requested a pre-release Dependabot audit. At Engine dev b4f84d31c4f181fc774d259a795a6ca883f69114, four alerts are open:
The Problem
The two browser packages have available fixes, but the current parents do not select them. Monaco 0.57.0 exact-pins DOMPurify 3.4.15; Mermaid 12.1.0 declares DOMPurify ^3.4.12 and KaTeX ^0.16.47. A routine lock refresh cannot move KaTeX to 0.18.2 or satisfy Monaco's pin with 3.4.16.
The inspected DOMPurify calls use strings rather than the advisories' Node/IN_PLACE path. Mermaid sanitizes KaTeX output before insertion. This is bounded source evidence, not an assertion that every embedder is safe.
The Architectural Reality
buildScripts/build/mermaid.mjs bundles the core ESM dependency graph. buildScripts/build/monaco.mjs already replaces the editor's vendored sanitizer import with the npm-resolved package and rejects leftover vendor copies. Patched npm resolutions must be verified in generated browser artifacts, not just the lockfile.
npm's override rule applies at the project root. This ticket repairs the Engine repository's own install and generated artifacts; a published consumer does not inherit that block. The generated consumer-root adoption remains with the existing create-app #38 owner, and existing apps need equivalent root floors before claiming their own remediation. The release-note owner granted the existing-app advisory in the same PR; it sits in the first Upgrading from13.1 table so the fix and instruction merge atomically.
The sprintf package is under gray-matter → js-yaml 3.15.2 → argparse 1.0.10. Engine's frontmatter path calls safeLoad rather than the YAML CLI. No attacker-controlled format-string path was found in that source census; the unresolved alert remains visible.
Design authority: the published advisories' affected/fixed ranges and the existing browser-build owners. No architecture change.
The Fix
Use package.json overrides to establish DOMPurify 3.4.16 and KaTeX 0.18.2 floors, then regenerate the lockfile. Also refresh fast-uri 3.1.7 → 3.1.8 inside Ajv's existing ^3.0.1 range; no new override is required. Retain the existing gray-matter/js-yaml and lodash-es rules. Verify KaTeX's move beyond Mermaid's declared minor range through representative diagram/math rendering, and rebuild both browser bundles.
Acceptance Criteria
Additional npm-audit findings
The broader audit also reports fast-uri GHSA-hrr3-gc8f-f4qj and braces GHSA-vfj7-8cjw-p6xm. Dependabot records 239/241 as auto_dismissed; their absence from the open-alert page is not a clean npm audit.
fast-uri has a compatible patched 3.1.8 release and is included here. Braces latest remains affected 3.0.3 with no published patch. The inspected Engine/WDS defaults pass fixed developer-owned glob patterns; request paths are matching data, not patterns. This bounds the known entry path without certifying custom consumers. No library replacement or decade-old downgrade from npm audit fix is selected.
Contract Ledger
| Surface |
Authority |
Behavior |
Fallback |
Evidence |
| npm dependency graph |
advisory floors / parent ranges |
DOMPurify ≥3.4.16, KaTeX ≥0.18.2, fast-uri ≥3.1.8 |
retain explicit unresolved advisories |
complete lock/tree and npm audit |
| generated browser assets |
Monaco npmSanitizer / Mermaid core ESM builders |
patched npm inputs execute in newly built assets |
build fails on a Monaco vendor fallback |
canonical bundles plus real wrapper/Portal smoke |
| unpatched tools |
upstream advisories and inspected call sites |
retain visible sprintf/braces findings with bounded exposure |
no fake fixed version or alert dismissal |
source census and recorded upstream state |
Out of Scope
Replacing parsers, upgrading Monaco/Mermaid themselves, dependency-wide updates, changing sanitizer APIs, and claiming installed-site remediation before its deployment.
Avoided Traps
Scanner-only Monaco repair; silent KaTeX override beyond its parent range without a rendering check; treating development scope as no browser exposure; a fake sprintf patch floor.
Related
#18354, #19320, #14800. Decision Record impact: none; structure map N/A for dependency metadata.
Origin Session ID: 2d8feac7-c60d-4883-8059-37b6e148768b
Retrieval Hint: pre-release Dependabot DOMPurify KaTeX sprintf-js browser bundles
Sweeps: live open/PR and historical package searches found no equivalent; #18354 and #19320 are closed predecessors with different advisory floors. Own assignments: 17844, 15520 and 14230 do not own these packages. MC package queries were non-diagnostic; primary package/advisory evidence governs. Fresh tracker/A2A recency rechecked immediately before creation.
Context
The operator requested a pre-release Dependabot audit. At Engine dev
b4f84d31c4f181fc774d259a795a6ca883f69114, four alerts are open:The Problem
The two browser packages have available fixes, but the current parents do not select them. Monaco 0.57.0 exact-pins DOMPurify 3.4.15; Mermaid 12.1.0 declares DOMPurify ^3.4.12 and KaTeX ^0.16.47. A routine lock refresh cannot move KaTeX to 0.18.2 or satisfy Monaco's pin with 3.4.16.
The inspected DOMPurify calls use strings rather than the advisories' Node/IN_PLACE path. Mermaid sanitizes KaTeX output before insertion. This is bounded source evidence, not an assertion that every embedder is safe.
The Architectural Reality
buildScripts/build/mermaid.mjsbundles the core ESM dependency graph.buildScripts/build/monaco.mjsalready replaces the editor's vendored sanitizer import with the npm-resolved package and rejects leftover vendor copies. Patched npm resolutions must be verified in generated browser artifacts, not just the lockfile.npm's override rule applies at the project root. This ticket repairs the Engine repository's own install and generated artifacts; a published consumer does not inherit that block. The generated consumer-root adoption remains with the existing create-app #38 owner, and existing apps need equivalent root floors before claiming their own remediation. The release-note owner granted the existing-app advisory in the same PR; it sits in the first Upgrading from13.1 table so the fix and instruction merge atomically.
The sprintf package is under gray-matter → js-yaml 3.15.2 → argparse 1.0.10. Engine's frontmatter path calls safeLoad rather than the YAML CLI. No attacker-controlled format-string path was found in that source census; the unresolved alert remains visible.
Design authority: the published advisories' affected/fixed ranges and the existing browser-build owners. No architecture change.
The Fix
Use
package.jsonoverrides to establish DOMPurify 3.4.16 and KaTeX 0.18.2 floors, then regenerate the lockfile. Also refresh fast-uri 3.1.7 → 3.1.8 inside Ajv's existing ^3.0.1 range; no new override is required. Retain the existing gray-matter/js-yaml and lodash-es rules. Verify KaTeX's move beyond Mermaid's declared minor range through representative diagram/math rendering, and rebuild both browser bundles.Acceptance Criteria
Additional npm-audit findings
The broader audit also reports fast-uri GHSA-hrr3-gc8f-f4qj and braces GHSA-vfj7-8cjw-p6xm. Dependabot records 239/241 as
auto_dismissed; their absence from the open-alert page is not a clean npm audit.fast-uri has a compatible patched 3.1.8 release and is included here. Braces latest remains affected 3.0.3 with no published patch. The inspected Engine/WDS defaults pass fixed developer-owned glob patterns; request paths are matching data, not patterns. This bounds the known entry path without certifying custom consumers. No library replacement or decade-old downgrade from
npm audit fixis selected.Contract Ledger
Out of Scope
Replacing parsers, upgrading Monaco/Mermaid themselves, dependency-wide updates, changing sanitizer APIs, and claiming installed-site remediation before its deployment.
Avoided Traps
Scanner-only Monaco repair; silent KaTeX override beyond its parent range without a rendering check; treating development scope as no browser exposure; a fake sprintf patch floor.
Related
#18354, #19320, #14800. Decision Record impact: none; structure map N/A for dependency metadata.
Origin Session ID: 2d8feac7-c60d-4883-8059-37b6e148768b
Retrieval Hint:
pre-release Dependabot DOMPurify KaTeX sprintf-js browser bundlesSweeps: live open/PR and historical package searches found no equivalent; #18354 and #19320 are closed predecessors with different advisory floors. Own assignments: 17844, 15520 and 14230 do not own these packages. MC package queries were non-diagnostic; primary package/advisory evidence governs. Fresh tracker/A2A recency rechecked immediately before creation.