Skip to content

fix(deps): update DOMPurify for sanitizer and document-context fixes - #19377

Merged
OrcaWin merged 1 commit into
mainfrom
OrcaWin/neil-sanitizer-dep-update
Sep 8, 2026
Merged

OrcaWin merged 1 commit into
mainfrom
OrcaWin/neil-sanitizer-dep-update

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Sep 7, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 0 0 0 0
Prod 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​10 $\color{#cf222e}{\Huge{\mathbf{−}}}$​10 0

Ready for review. Final validation evidence: 75,654 tests and Linux/Windows packaging pass; 17 rendered editor E2E tests pass; six real-browser sanitizer checks pass.

ELI5

Update DOMPurify 3.4.13 → 3.4.14 for sanitizer bypass and mixed-document-context fixes used by notebook HTML, Mermaid SVG and Monaco. Keep the direct dependency and Monaco override aligned; exactly one resolved package changes.

What Changed / Why

3.4.14 release and source comparison: repairs risky allow-listed tag bypasses and case-preserved attributes in mixed HTML/XML DOM contexts; adds SVG pointer-events/vector-effect attributes. Orca sanitizes notebook output using HTML/SVG/SVG-filter profiles and Mermaid with the SVG profile. The same maintained patch is consumed by Mermaid and the pinned Monaco dependency.

Keep exact 3.4.14 for this review. 3.4.15 was published September 6 and remains inside the workspace's three-day release-age gate; the gate is not bypassed. The update has source refactoring as well as fixes, so integration tests matter; no zero-regression guarantee is implied by the patch version.

Testing

On macOS arm64 with ORCA_BACKGROUND_LAUNCH=1:

  • Frozen install: passed. One resolved package version changed; no Tiptap, Electron or native module changes.
  • Entire editor Vitest directory: 208 files passed / 1 skipped; 1,410 tests passed / 2 skipped. Includes Markdown round trips, HTML/source handling, tables, links and editor consumers.
  • pnpm tc: passed.
  • pnpm run build:electron-vite: passed, including renderer boot-graph gate. Existing large-chunk warnings remain.
  • The separately tested Tiptap upgrade introduced Markdown regressions; it is isolated in fix(deps): migrate Tiptap security updates with Markdown compatibility guards #19376 and is not included here.
  • CI/rendered evidence will be posted against this PR's exact commit before marking ready.

No changes to sanitizer configuration, visual layout, remote wire frames, saved-file protocols, Git behavior or workspace assumptions. Sanitizer output tightening is intentional for hostile input; legitimate SVG behavior needs rendered coverage. Shared dependencies may reach remote-served content, so source filtering cannot be considered local-only.

Linked Issue

User-requested dependency review and full validation.

Visual Proof

N/A — dependency maintenance with no UI implementation change. Rendered checks are pending; no screenshot is claimed.

Review

  • Upstream fixes and exact package delta reviewed.
  • Local type/build/editor checks passed.
  • CI and rendered checks complete.
  • Agent skill upstream boundary not applicable.

@OrcaWin

OrcaWin commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator Author

Validation update for 107499c:

  • Entire existing editor suite with only DOMPurify bumped: 1,410 tests passed, 2 skipped; 208 files passed, 1 skipped. Typecheck and full Electron build passed.
  • Actual headless Chrome 152.0.7977.82, DOMPurify 3.4.14: 6 browser assertions passed, using Orca's notebook HTML/SVG and SVG-only sanitization profiles. Script elements, event handlers, javascript links and foreignObject content are removed; pointer-events/vector-effect survive; uppercase ONERROR on an XHTML-origin imported node is removed.

Observed sanitized results:

<p>safe</p><img src="x"><a>link</a>
<svg xmlns="http://www.w3.org/2000/svg"><rect width="20" height="20" pointer-events="none" vector-effect="non-scaling-stroke"></rect></svg>
<img xmlns="http://www.w3.org/1999/xhtml" src="x">

PR CI and focused rendered Orca E2E are running. Earlier manual E2E dispatch failed at checkout because I supplied a shortened SHA; it did not run application tests. The replacement uses the full SHA and verified spec filenames. Draft until these results are reviewed.

@OrcaWin

OrcaWin commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator Author

Additional combined-candidate validation (local, macOS arm64): merged #19361, #19369, #19377, #19378, #19362, #19380 and #19382 into local commit a610eca2303d94ad02199240c0d3afc11bc1757f. Blocked Tiptap #19376 is excluded. This supplements each PR's own exact-commit tests; it does not replace pending CI.

  • Combined frozen-lockfile install, full pnpm tc and pnpm run build:electron-vite: passed.
  • Existing editor + renderer i18n suites: 1,581 passed, 2 skipped; 227 files passed, 1 skipped.
  • 11 parser/query/URI/selector/plist/XML/browser-target/ID assertions: passed.
  • 5 real React Trans rendering/interpolation/language-switch assertions: passed.
  • 6 real headless Chrome sanitizer assertions on the combined installed DOMPurify: passed.
  • Actual combined Electron 43.6.0 / Node 24.20.0: native SQLite read/write, patched PTY spawn/output/exit and filesystem watcher event all passed.

All commands used ORCA_BACKGROUND_LAUNCH=1; no visible app window was opened. The only merge conflict was adjacent package.json entries: resolve by retaining both "dompurify": "3.4.14" and "electron": "43.6.0". Lockfiles merged automatically and the combined frozen install verified consistency. Leaf PR branches remain independent and unchanged; nothing has been merged into main.

@OrcaWin

OrcaWin commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator Author

Ready for review at 107499c71a3b109316c1e0c458c2cdfcd343d901.

  • Complete PR CI: 75,654 tests passed, 423 skipped across eight Node 24 shards; typecheck/static checks, Git and mixed-version wire contracts, shell/browser-provider checks, Linux and Windows packaging all passed.
  • Rendered Orca E2E: 17 passed across file opening/edit/save, nested toggles, table-row backspace, ordered-list exit, prose reflow and link-bubble stacking.
  • Local entire-editor suite 1,410 passed / 2 skipped, six actual Chrome sanitizer assertions and the combined-candidate validation above also passed.

The standalone 3.4.14 fix is compatible with the existing Tiptap version in these tests. It does not depend on the blocked Tiptap migration. 3.4.15 remains outside the repository's release-age gate; no policy bypass or unreviewed follow-on version is included.

@OrcaWin
OrcaWin marked this pull request as ready for review September 7, 2026 23:04
@coderabbitai

coderabbitai Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: c5da2bcf-ed68-4d87-83dd-197f96928373

📥 Commits

Reviewing files that changed from the base of the PR and between 2265fce and 107499c.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • package.json
  • pnpm-workspace.yaml

Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

The pull request updates the dompurify development dependency from ^3.4.13 to pinned version 3.4.14. It also updates the monaco-editor>dompurify workspace override from 3.4.13 to 3.4.14.

Merge Risk: ⚪ Minimal · up to 10749

This pins DOMPurify 3.4.14 for direct and Monaco sanitization usage, delivering the intended sanitizer hardening with aligned dependency resolution and no remaining merge-blocking risk.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is detailed and covers the change, rationale, testing, visual proof, and review status. It does not provide the required linked issue and contains stale unchecked review items despite … Add a valid issue reference in the Linked Issue section, such as Fixes #<issue-number>. Reconcile the unchecked CI and rendered-check items with the reported completed validation.
Linked Issues check ⚠️ Warning The required Linked Issue section does not contain an actual issue number or link. It only states that the change was user-requested. Add the issue reference that this pull request addresses, using the required format such as Fixes #<issue-number>.
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Out of Scope Changes check ✅ Passed The changes are limited to the DOMPurify version and the matching Monaco override. They align with the stated dependency-update objective.
Title check ✅ Passed The title clearly identifies a dependency update to DOMPurify and states the security and document-context purpose.
Full details: Description check

Explanation

The description is detailed and covers the change, rationale, testing, visual proof, and review status. It does not provide the required linked issue and contains stale unchecked review items despite final validation evidence.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

A DOMPurify patch bump (3.4.13 → 3.4.14) that tightens sanitizer behavior while keeping the direct dependency, the monaco-editor override, and the lockfile on a single resolved version.

  • Direct dependency pinned exact — package.json moves dompurify from ^3.4.13 to 3.4.14, matching the exact override.
  • Lockfile re-resolved — pnpm-lock.yaml updates the resolved version and integrity hash; both transitive consumers (mermaid, monaco-editor) land on 3.4.14.
  • Monaco override aligned — pnpm-workspace.yaml bumps monaco-editor>dompurify to 3.4.14.

Upstream 3.4.14 (released 2026-08-19) fixes allow-listed-tag bypasses and mixed HTML/XML document-context edge cases, and adds the SVG pointer-events/vector-effect attributes — additive or tightening for Orca's html/svg/svgFilters profiles in IpynbCellOutputs.tsx and MermaidBlock.tsx. Orca configures no ADD_TAGS allow-list, so the risky-tag bypass path isn't directly exercised; the only subtle parity risk is upstream's internal refactor, which the PR already flags and covers with rendered sanitizer checks. The mobile workspace keeps [email protected] only as a transitive mermaid dependency with no direct DOMPurify import, so it's correctly out of scope here.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@OrcaWin
OrcaWin merged commit 102402e into main Sep 8, 2026
70 of 78 checks passed
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.

1 participant