Skip to content

Commit

Permalink
Fix pentest issue 11: Unavalidated Redirects and Forwards
Browse files Browse the repository at this point in the history
  • Loading branch information
ballPointPenguin committed Nov 18, 2023
1 parent 550ecba commit 6b00053
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1262,8 +1262,9 @@ function initializePolisHelpers() {
});

// using hex since it doesn't require escaping like base64.
let dest = hexToStr(req.p.dest);
res.redirect(dest);
const dest = hexToStr(req.p.dest);
const url = new URL(dest);
res.redirect(url.pathname + url.search + url.hash);
}

function handle_GET_tryCookie(
Expand Down

0 comments on commit 6b00053

Please sign in to comment.