Skip to content

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

Merged
harsh-vador merged 2 commits into
2.1from
backport/2.1-safe-urls-and-markdown
Nov 3, 2026
Merged

harsh-vador merged 2 commits into
2.1from
backport/2.1-safe-urls-and-markdown

Conversation

@harsh-vador

Copy link
Copy Markdown
Contributor

Issue

Fixes #36804
Fixes #36805

Port of PR #36806 to the 2.1 release branch, plus the ArticleViewer change 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, and setEditorContent ran a final Markdown conversion whose output was never sanitized.

What changes

Tests

  • The changed test files plus the Learning player suites: 8 suites, 202 tests pass.
  • Callers (overview section, entity summary panel, search, block editor, rich text editor, Learning, StringUtils, sanitize): 67 of 68 suites pass. The failing suite, LearningResourcesSettings.test.tsx, fails the same 7 tests on unmodified origin/2.1 in this local setup, so it is not caused by this change.
  • eslint: 0 errors. The 3 warnings are also reported on the origin/2.1 versions of these files.
  • tsc --noEmit: no errors in the changed files.
  • Not run locally: Playwright. It runs in this PR's CI.

🤖 Generated with Claude Code

harsh-vador and others added 2 commits November 3, 2026 15:48
… 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)
Backport of the ArticleViewer change in #36156 to 2.1: the "open in new
tab" link on an article that failed to load uses getSafeHttpUrl, so a
non-http(s) source URL renders no href.

(cherry picked from commit ca9b8c0, ArticleViewer hunk only)
@harsh-vador harsh-vador added UI UI specific issues safe to test Add this label to run secure Github workflows on PRs labels Nov 3, 2026
@harsh-vador
harsh-vador requested a review from a team as a code owner November 3, 2026 10:28
@harsh-vador
harsh-vador requested review from Rohit0301 and removed request for a team November 3, 2026 10:29
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

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 skip-pr-checks label.

@harsh-vador harsh-vador self-assigned this Nov 3, 2026
@gitar-bot

gitar-bot Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
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.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 80%
80.21% (132676/165405) 66.84% (47052/70393) 69.87% (26654/38143)

@sonarqubecloud

sonarqubecloud Bot commented Nov 3, 2026

Copy link
Copy Markdown

@harsh-vador
harsh-vador merged commit 3bcb8b0 into 2.1 Nov 3, 2026
98 of 100 checks passed
@harsh-vador
harsh-vador deleted the backport/2.1-safe-urls-and-markdown branch November 3, 2026 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants