Skip to content

Commit

Permalink
ensure path param is valid path
Browse files Browse the repository at this point in the history
  • Loading branch information
avatus authored and github-actions committed Jul 1, 2022
1 parent 341ad99 commit da79a25
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/web/app/redirect.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ const js = `
}).then(response => {
if (response.ok) {
try {
window.location.replace(url.origin + path);
if (path.charAt(0) !== "/") {
throw "malformed url"
}
window.location.replace(url.origin + path);
} catch (error) {
// in case of malformed url, return to origin
window.location.replace(url.origin)
Expand Down

0 comments on commit da79a25

Please sign in to comment.