SiteShadow
Back to vulnerability library

N01 Insecure Redirects

What this means

SiteShadow flagged redirect logic where the destination URL can be influenced by user input (query params like ?next=..., returnUrl=..., redirect=...).

Why it matters

Open redirects can enable phishing, token leakage, or malicious navigation.

Safer examples

1) Use allowlisted relative paths (recommended)

const next = req.query.next || "/dashboard";
if (!next.startsWith("/")) throw new Error("Invalid redirect");
res.redirect(next);

2) If absolute URLs are needed, allowlist hosts

allowed = {"app.example.com"}
u = urlparse(next_url)
if u.hostname not in allowed:
    raise ValueError("Invalid redirect host")

3) Don't accept redirects from untrusted sources

Avoid reflecting arbitrary URLs back to clients.

How SiteShadow detects it (high level)

References

---

← Back to Vulnerability Library

Request access View coverage