JAVA-014 / Beginner
Open redirect (redirect: view)
Why is this a problem?
Users can be sent to phishing links.
How to fix it
java
@GetMapping("/go") String go(@RequestParam String next) {
if (!next.matches("^/[A-Za-z0-9/_-]*$")) return "redirect:/";
return "redirect:" + next;
}