Skip to content

Commit

Permalink
Merge pull request #905 from intuitem/hotfix/open-redirect
Browse files Browse the repository at this point in the history
Mitigate open redirect
  • Loading branch information
eric-intuitem authored Oct 8, 2024
2 parents 6034e60 + 7b80cff commit 6550815
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion frontend/src/lib/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export function formatScoreValue(value: number, max_score: number, fullDonut = f
}

export function getSecureRedirect(url: any): string {
const SECURE_REDIRECT_URL_REGEX = /^\/[^/]/;
const SECURE_REDIRECT_URL_REGEX = /^\/\w+/;
return typeof url === 'string' && SECURE_REDIRECT_URL_REGEX.test(url) ? url : '';
}

Expand Down

0 comments on commit 6550815

Please sign in to comment.