mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-06-07 00:46:58 +03:00
Prevent XSS and Open Redirect in login page.
This commit is contained in:
parent
b9e5ddf194
commit
8e09eec47d
1 changed files with 2 additions and 2 deletions
|
@ -83,8 +83,8 @@
|
||||||
<script>
|
<script>
|
||||||
function redirectNext() {
|
function redirectNext() {
|
||||||
const urlParams = new URLSearchParams(window.location.search);
|
const urlParams = new URLSearchParams(window.location.search);
|
||||||
const nextURL = urlParams.get('next');
|
const nextURL = urlParams.get('next').trim();
|
||||||
if (nextURL) {
|
if (nextURL && /(?:^\/[a-zA-Z_])|(?:^\/$)/.test(nextURL)) {
|
||||||
window.location.href = nextURL;
|
window.location.href = nextURL;
|
||||||
} else {
|
} else {
|
||||||
window.location.href = '/{{.basePath}}';
|
window.location.href = '/{{.basePath}}';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue