phpsafe 𝕏 GitHub
Official CA 421DTkQ3TSG3n7F9SkNZj9NxvdFGbypwkctPd2uupump This is the only official address.

Open redirect

Severity: Medium CWE-601 OWASP A01:2021 Broken Access Control rule: redirect

Why it matters

Attackers send links on your trusted domain that bounce visitors straight to phishing pages.

βœ• Vulnerable
header('Location: ' . $_GET['next']);
βœ“ Secure
$next = $_GET['next'] ?? '/';
if (!str_starts_with($next, '/') || str_starts_with($next, '//')) {
    $next = '/';
}
header('Location: ' . $next);

How to fix

Only redirect to paths on your own site or to a whitelist of known URLs.

Scan my code

Paste a file and PHP Safe points to every line that matches this rule.

Scan my code β†’