Repository navigation
fix(ui): link only http(s) URLs in the summary panel and article viewer, and sanitize the editor's final Markdown pass (backport 2.1 #36806) - #36933
Conversation
… editor's final Markdown pass (#36806) * fix(ui): only link http(s) URLs in the summary panel and quick-link search hits * fix(ui): sanitize the editor's final markdown conversion and parse it outside the live document * fix(security): bump minimatch to 11.0.4 in UI core components * Revert "fix(security): bump minimatch to 11.0.4 in UI core components" This reverts commit b0717d0. (cherry picked from commit ed0c6ec)
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
Code Review ✅ Approved🔴 High risk · Restricting external URLs and sanitizing the editor’s final Markdown changes security-sensitive rendering; overly broad filtering could hide legitimate links or alter editor content. Restricts external links in the summary panel, search quick-links, and article viewer to http(s) URLs and sanitizes the editor's final Markdown pass, as a backport to the 2.1 branch. No issues found. VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|



Issue
Fixes #36804
Fixes #36805
Port of PR #36806 to the 2.1 release branch, plus the
ArticleViewerchange from PR #36156. #36806 explains both problems: the summary panel's external URL rows and quick-link search hits put a stored URL into a link with no scheme check, andsetEditorContentran a final Markdown conversion whose output was never sanitized.What changes
CommonEntitySummaryInfoV1,SearchClassBase.getEntityLinkandBlockEditorUtilsare identical tomain, with fix(ui): link only http(s) URLs in the summary panel and sanitize the editor's final Markdown pass #36806's tests.ArticleViewer: the "open in new tab" link shown when an article fails to load usesgetSafeHttpUrl, as onmainsince fix(security): batch of backend security-hardening fixes #36156. Only that UI hunk is taken from fix(security): batch of backend security-hardening fixes #36156.Tests
StringUtils, sanitize): 67 of 68 suites pass. The failing suite,LearningResourcesSettings.test.tsx, fails the same 7 tests on unmodifiedorigin/2.1in this local setup, so it is not caused by this change.origin/2.1versions of these files.tsc --noEmit: no errors in the changed files.🤖 Generated with Claude Code