Repository navigation
chore(deps): raise the dompurify floor past the detached-subtree XSS - #2405
Merged
Merged
Conversation
GHSA-55q2-fjhq-7xh7: when a beforeSanitizeElements / uponSanitizeElement hook detaches the current node, _sanitizeElements() returns early without calling _neutralizeSubtree(). The detached subtree never reaches DOMPurify.removed, so IN_PLACE post-walk neutralization misses it and a descendant img can still fire its attacker-supplied onload after sanitize() returns. Both declaration sites sat at or below the vulnerable ceiling: the root override pinned ^3.4.12, which is the vulnerable version itself, and packages/app declared ^3.4.0. Raise both to ^3.4.13. Our own two call sites use the default config with no IN_PLACE and no hooks, so they are not in the vulnerable shape; monaco-editor bundles its own dompurify and is the path we cannot audit as cheaply. The key stays unscoped because only the 3.x line exists in the tree. Refs #2404 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2 tasks done
main moved the security floors out of the root package.json `pnpm.overrides` and into pnpm-workspace.yaml's `overrides:` (#2411 / ADR-2401) — pnpm 11 does not read the `pnpm` field at all. So the half of this branch's fix that lived in package.json had lost its home: taking it forward verbatim would have left a `pnpm` field pnpm 11 silently ignores. Resolved by taking main's package.json wholesale and re-applying the floor raise where the floors now live: pnpm-workspace.yaml `dompurify: ^3.4.12` -> `^3.4.13`. The direct declaration in packages/app merged cleanly and is unchanged. Re-ran the install under pnpm 11.20.0. The lock still resolves every dompurify to 3.4.13 with no 3.4.12 entry, and the diff against main is only the three dompurify lines. build and test pass. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This branch was successfully deployed
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.
Purpose
Closes #2404
Summary
Resolves Dependabot security alert #67 (medium, GHSA-55q2-fjhq-7xh7, CWE-79): during
IN_PLACEsanitization, a hook that detaches the current element makes_sanitizeElements()return early without_neutralizeSubtree(), so a descendant<img>can keep its attacker-suppliedonloadand fire aftersanitize()returns.Same shape as #2390 / #2392: an override for dompurify already existed, and its floor (
^3.4.12) was the vulnerable version itself.Changes
pnpm-workspace.yaml—overrides.dompurify:^3.4.12→^3.4.13packages/app/package.json— direct depdompurify:^3.4.0→^3.4.13pnpm-lock.yaml— refreshed under pnpm 11.20.0; no 3.4.12 entry remainsThe override key stays unscoped: only the 3.x line exists in the tree and the advisory covers all of
<= 3.4.12, so there is no other major to drag across a boundary.Note on the override's location
This branch originally raised the floor in the root
package.json'spnpm.overrides. While it was open, #2411 / ADR-2401 moved the security floors topnpm-workspace.yamland switched to pnpm 11, which does not read thepnpmfield at all. Merging main forward verbatim would have left the fix in a block pnpm 11 silently ignores, so the merge commit re-applies it where the floors now live.packages/appwas unaffected and merged cleanly.Exposure
Our own call sites are not in the vulnerable configuration — both are a default-config call with no
IN_PLACEand noaddHook:packages/app/src/components/ChatPane.tsx:199packages/app/src/components/NodeDetailPanel.tsx:69[email protected]bundles its own dompurify and is the path that is not as cheap to rule out.packages/appisprivate: trueso nothing is published, but it is deployed to Cloudflare Pages, so the runtime scope is real for the deployed UI. Practical risk is low; the patched version exists and the fix is a one-line floor raise, so there is no reason to dismiss.Verification
mainis three files and nothing else: the two dompurify declarations plus the lock lines they movepnpm buildpasses (exit 0) under pnpm 11.20.0pnpm testpasses (9 suites, exit 0)grep -c "[email protected]" pnpm-lock.yaml= 0Scope filter (new-feature PRs only)
Dependency & license impact
Manual Verification Checklist
TPL impact
Related Docs