Find open redirects and unsafe forward targets

Search for redirect and forward calls whose destination comes from input.

bash
grep -rEn "redirect(|sendRedirect|Location:|res.redirect|HttpResponseRedirect" --include=*.{java,py,js,ts,php,go} .

The bug trusts the parameter.

python
return redirect(request.GET["next"])   # next=https://evil.tld

Pro note: allow-list relative paths or a fixed host set; naive checks like startswith(“/”) are bypassable with //evil.tld and /evil.tld. Open redirects are low on their own but become high when they leak OAuth codes or bypass an SSRF host check.