Skip to content

chore(deps): raise the dompurify floor past the detached-subtree XSS - #2405

Merged
kompiro merged 2 commits into
mainfrom
chore/dependabot-security-20260808
Aug 9, 2026
Merged

kompiro merged 2 commits into
mainfrom
chore/dependabot-security-20260808

Conversation

@kompiro

@kompiro kompiro commented Aug 8, 2026 •

Copy link
Copy Markdown
Owner

Purpose

Closes #2404

Summary

Resolves Dependabot security alert #67 (medium, GHSA-55q2-fjhq-7xh7, CWE-79): during IN_PLACE sanitization, a hook that detaches the current element makes _sanitizeElements() return early without _neutralizeSubtree(), so a descendant <img> can keep its attacker-supplied onload and fire after sanitize() 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.13
  • packages/app/package.json — direct dep dompurify: ^3.4.0 → ^3.4.13
  • pnpm-lock.yaml — refreshed under pnpm 11.20.0; no 3.4.12 entry remains

The 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's pnpm.overrides. While it was open, #2411 / ADR-2401 moved the security floors to pnpm-workspace.yaml and switched to pnpm 11, which does not read the pnpm field 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/app was unaffected and merged cleanly.

Exposure

Our own call sites are not in the vulnerable configuration — both are a default-config call with no IN_PLACE and no addHook:

  • packages/app/src/components/ChatPane.tsx:199
  • packages/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/app is private: true so 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

  • Diff against main is three files and nothing else: the two dompurify declarations plus the lock lines they move
  • pnpm build passes (exit 0) under pnpm 11.20.0
  • pnpm test passes (9 suites, exit 0)
  • grep -c "[email protected]" pnpm-lock.yaml = 0

Scope filter (new-feature PRs only)

  • N/A — not a new-feature PR

Dependency & license impact

  • N/A — no production dependency added or bumped across a major version

Manual Verification Checklist

TPL impact

Disposition: N/A — dependency floor raise, no behavior change.

Related Docs

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]>
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]>
@kompiro
kompiro merged commit ccb2ce4 into main Aug 9, 2026
10 checks passed
@kompiro
kompiro deleted the chore/dependabot-security-20260808 branch August 9, 2026 00:26

This branch was successfully deployed

1 active deployment
preview — 072c6685 Deployed Aug 9, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore(deps): resolve Dependabot security alert for dompurify (GHSA-55q2-fjhq-7xh7)

1 participant