Open Redirects

Easy

Looks for endpoints that redirect to any address given in a query parameter such as redirect or next.

Estimated fix time: 20 minutes

What this check looks for

StackShield requests your login, logout and registration pages, the common redirector paths such as /redirect and /out, and any link on your home page that already uses a redirect-style parameter. Each request carries the usual parameter names (redirect, next, url, return_to and others), each pointing at a made-up host under example.com. If the response redirects to one of those hosts, the endpoint is an open redirect and the host shows which parameter caused it.

The test is repeated with the address written as //host, which gets past filters that only reject values starting with http.

Why it matters

An open redirect lets an attacker build a link that starts with your real domain and ends on their page. That defeats the one check most people make before clicking, so it is a staple of phishing. On endpoints involved in sign-in it can also leak OAuth codes or tokens that are appended to the redirect address.

What the findings mean

A medium finding names the path and the parameter that redirected off-site. A warning means a sign-in form carried the external address forward in a hidden field. Whether it is honoured after sign-in cannot be tested anonymously, so try it once by hand.

Redirect only to relative paths or to an explicit allowlist of hosts, and reject values that start with a scheme, // or a backslash. redirect()->intended() and named routes avoid the problem entirely.

Automatically detect this issue

StackShield can automatically scan your Laravel application for this security issue and alert you when it's detected.

Start Free Trial
Was this guide helpful?