How to fix: Confirmed Open Redirect via Location Header
The scanned URL contained a redirect-style query parameter (next, redirect, url, goto, dest, redir, returnTo, continue, forward, or target) whose value was an absolute URL pointing to an external host, and the response's Location header sent the browser to that exact external host. This is a confirmed match between the request parameter and real server redirect behavior, not a static text guess: the server used the parameter to build the redirect target with no allowlist blocking an off-domain destination.
Why it matters
An attacker sends victims a link on your trusted domain (yoursite.com/login?next=https://evil.com/phish) and the server itself performs the hop to the attacker's site. Victims who trust the initial domain are far more likely to enter credentials or approve an OAuth-style consent screen on the page they land on afterward.
The parameter value and the Location header host were both observed on the same response: this is not a pattern found in page source, it is the server's actual 3xx (or Location-bearing) response for the exact URL that was scanned. Same-host and same-organization (e.g. app.example.com to accounts.example.com) redirects are excluded, so this only fires when the destination is a genuinely different registrable domain.
How to fix it
- 1Validate the parameter value against an allowlist of permitted redirect destinations before building the Location header.
- 2Prefer relative paths for internal redirects instead of accepting absolute URLs at all.
- 3If external redirects are a real product requirement (e.g. payment return URLs), store the permitted destination server-side per client/integration rather than trusting the raw request value.
- 4Reject any parameter value starting with http://, https://, or // unless it matches the allowlist.
Code examples
Allowlist redirect destinations
const ALLOWED_HOSTS = new Set(['yourdomain.com']);
function safeRedirectTarget(next: string): string {
if (next.startsWith('/')) return next; // relative is always fine
try {
const parsed = new URL(next);
if (ALLOWED_HOSTS.has(parsed.hostname)) return parsed.href;
} catch {
// fall through to default
}
return '/dashboard';
}References
Detected automatically by VulnRadar. The check id is open-redirect-location-confirmed, stable across every scan so you can filter or diff on it.
More host validation checks
- HighHost Header Injection Risk
- MediumSymfony Debug Token Header Exposed
- HighHTTP Request Smuggling Indicator
- HighHTTP Basic Authentication Over Non-HTTPS
- MediumASP.NET ViewState Without MAC Protection
- HighCache Poisoning via Unkeyed Headers
- LowSequential Numeric ID in URL (IDOR Risk)
- HighConfirmed Open Redirect via Meta Refresh
Questions
- How severe is Confirmed Open Redirect via Location Header?
- VulnRadar rates this high severity in the host validation category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
- Does VulnRadar check for this automatically?
- Yes. It runs as part of every scan under the check id open-redirect-location-confirmed, which stays the same between runs so you can filter, diff, or gate CI on it.
- Which standards does Confirmed Open Redirect via Location Header map to?
- It maps to CWE-601. In the OWASP Top 10 it falls under A01:2021.
Missing a check?
The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.