monaco-editor icon indicating copy to clipboard operation
monaco-editor copied to clipboard

Bump bundled DOMPurify to 3.4.12+ (0.56.0 ships 3.4.8)

Open davidnmbond opened this issue 3 months ago • 6 comments

[email protected] depends on [email protected].

Two DOMPurify advisories land above that version:

CVE Fixed in DOMPurify
CVE-2026-65898 3.4.11
CVE-2026-66010 3.4.12

DOMPurify 3.4.13 is current on npm.

Why this matters to embedders specifically

DOMPurify is bundled into the shipped monaco artifacts (e.g. min/vs/editor.api-*.js) rather than resolved at the consumer's dependency graph. That means downstream consumers cannot upgrade it themselves — the only options are to hand-patch a third-party bundle, or wait.

In practice it surfaces as a "Vulnerable JS Library" finding against every site embedding Monaco, and there is no consumer-side remediation to offer in response.

Would you consider bumping the DOMPurify dependency to 3.4.12 or later?

Note on severity

I appreciate Monaco uses DOMPurify for its own internal sanitisation (markdown in hovers, suggestion documentation and similar), so the practical exposure for many embedders is lower than a raw CVE count suggests. This is raised as dependency hygiene and to remove a recurring, unactionable scanner finding for embedders, not as a report of an exploitable path in Monaco itself.

davidnmbond avatar Aug 15 '26 20:08 davidnmbond

linked: https://github.com/microsoft/monaco-editor/issues/5352

Viktor-Ivliev avatar Aug 19 '26 11:08 Viktor-Ivliev

Hi — thanks for the clear write-up, and for framing this as embedder hygiene rather than a Monaco exploit path.

I would be happy to help land a bump to DOMPurify ≥3.4.12 (likely 3.4.14, current on the registry). From #5333 / #5347 it looks like the bundled copy is driven by the vendored files in microsoft/vscode (src/vs/base/browser/dompurify/, still on 3.4.8 in cgmanifest.json), so a lockfile-only change here would not stick.

Would you (and the maintainers) prefer:

  1. a vscode built-in dompurify bump PR first, then a monaco-editor-core / lockfile follow-up here, or
  2. guidance on another path you already have in mind?

Happy to take whichever approach you prefer. Thanks!

KinsonAu03 avatar Aug 25 '26 01:08 KinsonAu03

it seems to be fixed in monaco-editor v0.57.0.

$ npm view [email protected] --json dependencies
{
  "marked": "14.0.0",
  "dompurify": "3.4.15"
}

okuryu avatar Sep 25 '26 02:09 okuryu

3.4.15 is still too old. This needs to be updated to 3.4.16 to address this:

https://github.com/advisories/GHSA-p98j-92pf-mc4p

Better yet, just use a range version?

kgetz-arista avatar Sep 30 '26 19:09 kgetz-arista

3.4.16 has 3 more issues:

https://github.com/advisories/GHSA-cg2g-xh64-v4q7 https://github.com/advisories/GHSA-mrv2-3pqr-j5jr https://github.com/advisories/GHSA-c6gr-qvv4-5v3f

kgetz-arista avatar Oct 22 '26 19:10 kgetz-arista

monaco-editor 0.57.0 (now latest) bundles DOMPurify 3.4.15, verified in the published package. That covers CVE-2026-65898 (fixed in 3.4.11) and CVE-2026-66010 (fixed in 3.4.12), so I'm closing this.

The later advisories mentioned here (GHSA-p98j-92pf-mc4p, GHSA-6688-9rhm-gjv2, GHSA-cg2g-xh64-v4q7, GHSA-mrv2-3pqr-j5jr, GHSA-c6gr-qvv4-5v3f) need IN_PLACE, SAFE_FOR_TEMPLATES or PARSER_MEDIA_TYPE: 'application/xhtml+xml'. Monaco uses none of these. Monaco's DOMPurify comes from VS Code, which already vendors 3.4.16, so future releases will pick that up.

hediet avatar Nov 02 '26 10:11 hediet