-
Notifications
You must be signed in to change notification settings - Fork 6
Digg 472 Follow specification face #526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Browser navigation fix
DIGG-450: Fixing organisation page name
data.terms.termsInfo = termsList | ||
.map((t) => ({ | ||
title: getLocalizedValue(t.getAllMetadata(), "dcterms:title"), | ||
url: t.getResourceURI().startsWith("https://dataportal.se") |
Check failure
Code scanning / CodeQL
Incomplete URL substring sanitization High
https://dataportal.se
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 8 months ago
To fix the problem, we need to parse the URL and check its host value instead of using a simple string comparison. This ensures that the check handles arbitrary subdomain sequences correctly and prevents bypassing the security check.
- Parse the URL using the
URL
constructor to extract the host value. - Compare the host value with the allowed host "dataportal.se".
- Update the relevant code in the file
providers/entrystore-provider/index.tsx
.
-
Copy modified line R567
@@ -566,3 +566,3 @@ | ||
title: getLocalizedValue(t.getAllMetadata(), "dcterms:title"), | ||
url: t.getResourceURI().startsWith("https://dataportal.se") | ||
url: new URL(t.getResourceURI()).host === "dataportal.se" | ||
? new URL(t.getResourceURI()).pathname.replace( |
New filter on datasets that follows a soecification.
https://dgroupse.atlassian.net/browse/DIGG-472