Repository navigation
fix(ui): link only http(s) URLs in the summary panel and sanitize the editor's final Markdown pass - #36806
Conversation
❌ 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 |
|
| Count | Rule |
|---|---|
| 1 | react-hooks/exhaustive-deps |
| 1 | openmetadata-imports/no-circular-imports |
| 1 | openmetadata-imports/no-lower-layer-page-imports |
All findings
| Location | Rule | Message | |
|---|---|---|---|
| 🟡 | src/components/common/OverviewSection/CommonEntitySummaryInfoV1.tsx:57:6 |
react-hooks/exhaustive-deps |
React Hook useMemo has a missing dependency: 't'. Either include it or remove the dependency array. |
| 🟡 | src/utils/BlockEditorUtils.ts:23:1 |
openmetadata-imports/no-circular-imports |
This runtime import participates in a circular dependency. Extract the shared type/constant/utility or invert the dependency. |
| 🟡 | src/utils/SearchClassBase.ts:62:1 |
openmetadata-imports/no-lower-layer-page-imports |
Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here. |
Fix locally (fast - only checks files changed in this branch):
make ui-checkstyle-changedThis reverts commit b0717d0.
|
2.0 backport: #36815 |
Code Review ✅ Approved🟡 Medium risk · The HTTP(S) link restriction and final editor sanitization alter rendered content, potentially suppressing legitimate non-HTTP links or Markdown markup. Restricts external URL rows in the summary panel and quick-link search hits to http(s) URLs, and sanitizes the rich text editor's final Markdown conversion before parsing it outside the live document. 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 |
|



Describe your changes:
Fixes #36804
Fixes #36805
Fixes 8379
Two small UI hardening fixes, one commit each.
1. Only link http(s) URLs in the summary panel and quick-link search hits (#36804)
The Explore summary panel's external URL rows and the link of a Context Center quick-link search hit now accept only http(s) URLs. This is the rule #34070 introduced with
getSafeHttpUrl, which the olderCommonEntitySummaryInfoand every other quick-link renderer already apply. Anything else renders as plain text.CommonEntitySummaryInfoV1: forisExternalrows, the URL goes throughgetSafeHttpUrlbefore it reaches eitherButtonbranch: the new-tab link, and the same-window link used when the row text is-. This covers the pipeline, dashboard and chart URL rows, the ML model server row and the API collection/endpoint URL rows. Internal rows are unchanged.SearchClassBase.getKnowledgePageEntityLink: a quick link's URL goes throughgetSafeHttpUrl, and the handler returns''when it is not http(s). This link feeds the summary panel title, the Explore result card and the global search suggestion.2. Sanitize the rich text editor's final Markdown conversion (#36805)
Content reaches the editor after
formatClientContenthas converted and sanitized it, once in the previewer and once inBlockEditor.setEditorContentthen converted it a third time without sanitizing. Each conversion removes one level of backslash escaping, so text that stayed inert through the sanitized passes could become markup in the unsanitized one.setEditorContent: the conversion result goes throughgetSanitizeContent. This is the same sanitizer and config as the earlier passes, and it keeps<#E::…>entity links andblock-math-equation. Already-clean content comes out unchanged.transformImgTagsToFileAttachment: parses withDOMParser(text/html) and serializesbody, asformatClientContentalready does, instead of filling an element of the live document.Every caller goes through
setEditorContent:BlockEditorandRichTextEditor's imperative handle. So this covers descriptions, the rich-text previewers, feed messages, replies and task comments.Not included:
minimatch(Dependabot #818, #819, #820)An earlier revision bumped the core components'
minimatchresolution to 11.0.4, the only fixed line for GHSA-g3hv-75wg-m249. It is reverted here. 11.0 changesMinimatch.set, and theglob@7insidei18next-json-syncthen crashes (Cannot read properties of undefined (reading 'charAt')), which brokeyarn check-i18n-all. Pinning^3consumers back to 3.1.5 wouldn't close the alert either, since 3.1.5 is also below 11.0.1.minimatchhere is build and lint tooling that only matches repository-authored patterns. The vulnerableoptimizationLevelpreprocessing exists in 10.x but not in 3.1.5. I suggest dismissing #818 as tolerable risk, and #819/#820 (3.1.5) as inaccurate. #713 (@tiptap/core) needs the editor's tiptap v3 migration.Type of change:
High-level design:
N/A, small changes.
Tests:
Use cases covered
javascript:, mixed-caseJaVaScRiPt:ordata:renders its text with nohref, with a display name and with the-fallback. http(s) rows still open in a new tab withrel="noopener noreferrer".formatClientContenttwice and still holds an escaped Markdown image or link with quote-delimited attributes reaches the editor without event-handler attributes. The image still becomes a file attachment and the link keeps itshref.transformImgTagsToFileAttachmentno longer assignsinnerHTMLon an element of the live document.Unit tests
CommonEntitySummaryInfoV1.test.tsx,SearchClassBase.test.tsandBlockEditorUtils.test.ts.DataAssetSummaryPanelV1,Explore/EntitySummaryPanel,ExploreV1,ExploreSearchCard,SearchUtils,AppBar,DataAssetSummaryPanelUtils,OverviewSection): 17 suites, 388 tests pass.utils/BlockEditor*,components/BlockEditor,RichTextEditor,ActivityFeed,EntityDescription,sanitize,FeedUtils): 72 suites, 853 tests pass.OverviewSection: 4 suites, 177 tests pass.main, 5 of the new URL tests and both new editor tests fail.tsc --noEmitreports no errors in them.Backend integration tests
Playwright (UI) tests
Not run locally.
make playwright_affectedselects 21 specs for each UI change. They run in this PR's CI.yarn build && yarn bundle:runtimeon this branch passes locally: 151 route chunks load with no unexpected undefined exports.yarn check-i18n-allin core components passes.Manual testing performed
I ran this branch's UI (
vite) against a local server in Chromium (Playwright) and signed in as admin. The test values were written into the API responses in the browser only, so nothing was stored. Each test value sets a flag onwindowif it runs, and the check reads that flag back.sourceUrlset to ajavascript:URL and no display name, so the "Pipeline URL" row falls back to-. On this branch the row has nohref, and clicking it runs nothing.Control: I swapped
CommonEntitySummaryInfoV1.tsxandBlockEditorUtils.tsback tomainunder the same server and repeated both steps. The row rendered thejavascript:URL as itshrefand ran it on click, and the description's handler ran on page load. The control screenshots are kept off this public PR.🤖 Generated with Claude Code