[Vulnerability] Cross site scripting (XSS) and Open Redirect on the login page (#396)

This commit is contained in:
Hoang Nguyen 2023-06-23 14:42:39 +07:00 committed by GitHub
parent 28f3e820f0
commit 6bbe230fe8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -84,7 +84,7 @@
function redirectNext() {
const urlParams = new URLSearchParams(window.location.search);
const nextURL = urlParams.get('next');
if (nextURL) {
if (nextURL && /(?:^\/[a-zA-Z_])|(?:^\/$)/.test(nextURL.trim())) {
window.location.href = nextURL;
} else {
window.location.href = '/{{.basePath}}';