Open redirect and SSRF in Laravel sites: a short checklist
Using an address parameter as-is leads to two classic flaws.
Open redirect
Code such as redirect($request->input('next')) lets an attacker build a trusted-looking link on your site that sends people to a malicious address.
- Accept only relative paths on your own site (starting with
/, not//). - Or compare against an allow-list of domains.
SSRF
If your server makes a request to a user-supplied URL (previews, webhooks, image downloads), an attacker tries to reach your internal network: addresses like 127.0.0.1 or 169.254.169.254.
- Allow only the
httpsscheme. - Resolve the hostname and check that the result is not a private or local IP.
- Do not follow redirects, or re-check at every hop.
- Set a timeout and a response size limit.
Extra checks
Run composer audit and keep dependencies current. Review session and cache settings of the admin panel.