Repository navigation
fix: pin dompurify to 3.4.17 to clear the critical audit - #238
Merged
Merged
Conversation
monaco-editor 0.57.0 still depends on dompurify 3.4.15, and the override that forced 3.4.16 is now inside the critical advisory range. 3.4.17 is the first patched release. No newer Monaco release exists. Co-authored-by: Mohammad Naim Faizy <mnaimfaizy@users.noreply.github.com>
mnaimfaizy
marked this pull request as ready for review
October 23, 2026 05:06
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.
Cause
After #237 merged to main as
11c7e95, Secure Install Review failed again onnpm audit --audit-level=high. The new finding is critical, and it is not Vite.monaco-editor@0.57.0depends ondompurify@3.4.15. An override already forcesdompurify@3.4.16so the tree does not install 3.4.15. Advisories published on 2026-10-22 put every release through 3.4.16 in range, including that override:SAFE_FOR_TEMPLATESbypass via shadow roots>= 3.4.4, <= 3.4.16IN_PLACEleaves event handlers armed<= 3.4.16attributeName=hrefskipped in XHTML mode<= 3.4.16npm auditreports this as critical ondompurify <= 3.4.16, reached throughmonaco-editor >= 0.56.0-dev-20260113. Its only suggested fix isnpm audit fix --force, which installsmonaco-editor@0.55.1. That is a downgrade from 0.57.0. There is no Monaco release newer than 0.57.0. The audit threshold is unchanged.Fix
Move the existing override from
dompurify@3.4.16todompurify@3.4.17.3.4.17(2026-10-12) is the first patched release and the newest release, and it is at least 7 days old. The published package has no install lifecycle script (prepareis husky, which npm does not run for a registry dependency). No newnode_modulesentries. The lockfile only changes thedompurifyversion, tarball URL, and integrity. The URL stays onhttps://registry.npmjs.org/.npm audit --audit-level=highexits 0. Three moderate Vitest findings (GHSA-p458-7748-mcp3) remain and are below that gate. They are already in the open development group PR.What this does not change
Monaco 0.57.0 also vendors DOMPurify 3.4.15 at
esm/vs/base/browser/dompurify/dompurify.jsand imports that file, not the npm package. The override replaces the package npm audits. It does not rewrite Monaco's vendored copy. No newer Monaco release vendors 3.4.17, and downgrading Monaco to 0.55.1 is the breaking change this PR avoids.Justification
DOMPurify is already in the tree because Monaco declares it. The override is the patched release of that package, not a new dependency.
Local verification
npm ci --ignore-scriptsleftpackage-lock.jsonunchanged.npx tsc -b,npm run lint,npm run test:run(1538 tests),npm run build, and the three.js chunk check passed.The Playground at
/playgroundloaded Monaco with line numbers and syntax highlighting. Typingconst dompurifyCheck = 1;showed up in the editor, and Run executed the buffer: the console printed the sample output and the step view listeddompurifyCheck.