fix: prevent malicious url in unsupported browser redirect

Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
This commit is contained in:
John Molakvoæ 2023-05-11 08:56:15 +02:00
parent f1bfd7fd48
commit d8392fc62f
No known key found for this signature in database
GPG key ID: 60C25B8C072916CF
3 changed files with 7 additions and 5 deletions

View file

@ -141,8 +141,10 @@ export default {
const urlParams = new URLSearchParams(window.location.search)
if (urlParams.has('redirect_url')) {
const redirectPath = Buffer.from(urlParams.get('redirect_url'), 'base64').toString() || '/'
window.location = redirectPath
return
if (redirectPath.startsWith('/')) {
window.location = generateUrl(redirectPath)
return
}
}
window.location = generateUrl('/')
},

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long