[codex] Fix draw UI audit dependency chain#80
Closed
jbeckwith-oai wants to merge 1 commit intomainfrom
Closed
Conversation
Move the draw UI off the Excalidraw 0.18.0 dependency chain that pulls in the vulnerable Mermaid and DOMPurify versions flagged by npm audit. Use the audit-safe upstream combination of Excalidraw 0.17.6 with React 18, and update the app imports to match the older package layout. Checks: npm audit, npx tsc --noEmit, npm run build Co-authored-by: Codex <noreply@openai.com>
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.
What changed
This updates
plugins/draw/uito use the audit-safe upstream dependency combination:@excalidraw/excalidrawfrom0.18.0to0.17.6Why
npm auditwas flagging the@excalidraw/excalidraw@0.18.0dependency chain formermaid,dompurify, andnanoid.Before changing anything, I checked whether the app was actually exposed to those advisories.
dompurifyfindings were not all clearly reachable in this embed.nanoidfinding did not appear to be exploitable here because the affected call pattern requires fractional size arguments, and the packaged call sites use plainnanoid().mermaidfinding was the meaningful one: this UI mounts stock Excalidraw, which includes Mermaid import support in the bundled dependency chain, so user-initiated import of untrusted Mermaid content was still enough to leave a real XSS path in scope.Given that, the fix here is to remove the vulnerable upstream chain rather than add lockfile overrides.
Impact
npm auditis clean forplugins/draw/uiValidation
npm audit --jsonnpx tsc --noEmitnpm run buildBuild still emits the existing Vite chunk-size warning for the large Excalidraw bundle, but the build succeeds.