Repository navigation
fix(ui): only render http(s) URLs as external link hrefs - #34070
Conversation
Entity summary sourceUrl and ML model storage/imageRepository values were rendered straight into href, so a stored javascript: URL became a clickable XSS vector, and the summary link opened target=_blank without rel=noopener. Extract the existing protocol allowlist (duplicated in GlossaryTermBadges and PropertyValue) into getSafeHttpUrl in StringUtils and use it for all four call sites. Non-http(s) ML store values render as plain text. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
❌ 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 |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
✅ Playwright Results — workflow succeededValidated commit ✅ 4618 passed · ❌ 0 failed · 🟡 3 flaky · ⏭️ 1 skipped · 🧰 0 lifecycle flaky PerformanceBlocking targets: ✅ met · Optimization targets: 🟡 in progress Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting. 🕒 Full workflow signal wall (to summary) 54m 13s ⏱️ Max setup 4m 34s · max shard execution 21m 33s · max shard-job elapsed before upload 25m 9s · reporting 12s 🌐 219.56 requests/attempt · 2.20 app boots/UI scenario · 43.46% common-shard skew Optimization targets still in progress:
🟡 3 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
🔄 Playwright impact map auto-refreshedThis PR touched specs or UI source that changed the source→spec routing map. I regenerated What is this file? It is the auto-generated half of Playwright's PR planner. It routes "if source X changes, run specs Y" by walking spec imports and cross-referencing What if I want to regenerate locally instead? Run this before pushing your next change to skip the bot commit: python3 .github/scripts/generate_playwright_impact_map.py
git add .github/playwright/impact-map.generated.json
git commit --amend --no-edit # or a separate commit |
Code Review ✅ Approved🟡 Medium risk · Restricts multiple UI hrefs to HTTP(S), changing rendering of unsafe URLs. Fixes stored-XSS vulnerabilities where ingested URLs were rendered directly as OptionsDisplay: compact → Counting what did not apply, without listing it. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
| Count | Rule |
|---|---|
| 13 | react-hooks/exhaustive-deps |
All findings
| Location | Rule | Message | |
|---|---|---|---|
| 🟡 | src/components/MlModel/MlModelDetail/MlModelDetail.component.tsx:146:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has a missing dependency: 't'. Either include it or remove the dependency array. |
| 🟡 | src/components/MlModel/MlModelDetail/MlModelDetail.component.tsx:158:6 |
react-hooks/exhaustive-deps |
React Hook useMemo has a missing dependency: 'currentUser?.id'. Either include it or remove the dependency array. |
| 🟡 | src/components/MlModel/MlModelDetail/MlModelDetail.component.tsx:188:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has missing dependencies: 'fetchActivityCount' and 'fetchTaskCounts'. Either include them or remove the dependency array. |
| 🟡 | src/components/MlModel/MlModelDetail/MlModelDetail.component.tsx:215:5 |
react-hooks/exhaustive-deps |
React Hook useCallback has a missing dependency: 'settingsUpdateHandler'. Either include it or remove the dependency array. If 'settingsUpdateHandler' changes t |
| 🟡 | src/components/MlModel/MlModelDetail/MlModelDetail.component.tsx:272:5 |
react-hooks/exhaustive-deps |
React Hook useMemo has a missing dependency: 't'. Either include it or remove the dependency array. |
| 🟡 | src/components/MlModel/MlModelDetail/MlModelDetail.component.tsx:292:6 |
react-hooks/exhaustive-deps |
React Hook useMemo has a missing dependency: 't'. Either include it or remove the dependency array. |
| 🟡 | src/components/MlModel/MlModelDetail/MlModelDetail.component.tsx:314:6 |
react-hooks/exhaustive-deps |
React Hook useMemo has a missing dependency: 't'. Either include it or remove the dependency array. |
| 🟡 | src/components/MlModel/MlModelDetail/MlModelDetail.component.tsx:335:6 |
react-hooks/exhaustive-deps |
React Hook useMemo has a missing dependency: 't'. Either include it or remove the dependency array. |
| 🟡 | src/components/MlModel/MlModelDetail/MlModelDetail.component.tsx:346:5 |
react-hooks/exhaustive-deps |
React Hook useCallback has a missing dependency: 'navigate'. Either include it or remove the dependency array. |
| 🟡 | src/components/MlModel/MlModelDetail/MlModelDetail.component.tsx:373:6 |
react-hooks/exhaustive-deps |
React Hook useMemo has a missing dependency: 'feedCount'. Either include it or remove the dependency array. |
| 🟡 | src/components/MlModel/MlModelDetail/MlModelDetail.component.tsx:413:5 |
react-hooks/exhaustive-deps |
React Hook useMemo has a missing dependency: 'tabs'. Either include it or remove the dependency array. |
| 🟡 | src/components/MlModel/MlModelDetail/MlModelDetail.component.tsx:413:6 |
react-hooks/exhaustive-deps |
React Hook useMemo has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked. |
| 🟡 | src/components/common/CustomPropertyTable/PropertyValue.tsx:1195:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has missing dependencies: 'isRenderedInRightPanel' and 'propertyType.name'. Either include them or remove the dependency array. |
Fix locally (fast - only checks files changed in this branch):
make ui-checkstyle-changed
|
* fix(ui): only render http(s) URLs as external link hrefs Entity summary sourceUrl and ML model storage/imageRepository values were rendered straight into href, so a stored javascript: URL became a clickable XSS vector, and the summary link opened target=_blank without rel=noopener. Extract the existing protocol allowlist (duplicated in GlossaryTermBadges and PropertyValue) into getSafeHttpUrl in StringUtils and use it for all four call sites. Non-http(s) ML store values render as plain text. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * style(ui): sort StringUtils import in MlModelDetail Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * chore(playwright): auto-refresh impact-map.generated.json --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>



Describe your changes
Security scan (collate run 36210692020) flagged two stored-XSS paths where ingested URLs go straight into
href:CommonEntitySummaryInfo— externalsourceUrllinks rendered withhref={info.url}andtarget="_blank"but norel(XSS viajavascript:+ tabnabbing).MlModelDetail— ML storestorage/imageRepositoryrendered as rawhref.Fix
getSafeHttpUrl(url)inutils/StringUtils.ts: returns the URL only when it parses ashttp:/https:, elseundefined.GlossaryTermBadges(getSafeReferenceHref) andPropertyValue(inlineisSafeUrl); both now use the shared helper.CommonEntitySummaryInfo:href={getSafeHttpUrl(info.url)}+rel="noopener noreferrer".MlModelDetail: only http(s) values render as links (withrel="noopener noreferrer"); anything else — includings3://…storage paths, which browsers can't open anyway — renders as plain text.Tests
StringUtils.test.ts: accepts http/https; rejectsjavascript:(incl. mixed case/leading space),data:,ftp:,s3:, empty, invalid.CommonEntitySummaryInfo.test.tsx: assertsrel, and nohreffor ajavascript:URL.MlModelDetail.component.test.tsx:javascript:store value is not a link; https one is, withrel.Local: jest across the 6 touched suites — 166/166 pass; eslint 0 errors; prettier clean.
Type of change
🤖 Generated with Claude Code