On this page
What this issue is
An open redirect happens when your site takes a destination from the URL (for example ?redirect=, ?next=, ?url=, ?return_to=) and sends the visitor there without checking it. The link starts on your domain, but the visitor ends up somewhere else.
It is common in login pages, logout flows, tracking links, language switchers and "thank you" pages. Developers add it for convenience: send the user back to where they were. The mistake is trusting whatever address arrives.
https://yoursite.com/login?next=https://evil.example/fake-loginWhy it costs you leads or sales
Phishers love open redirects. The link shows your real domain, so people and email filters trust it. A customer who clicks may land on a fake login page and blame your brand.
There is an ad risk too. Ad platforms review the final destination of a click path. If a redirect on your domain can lead to harmful or unrelated sites, ads that use it can be disapproved or your domain can be flagged. Policies vary, so check the current rules of each platform.
- Attacker crafts linkYour domain plus ?next=evil site
- Victim clicksSees your trusted domain
- Your site redirectsNo check on the destination
- Fake pageSteals logins or card details
- Your brandTrust and reputation damaged
The trusted link is the only step that looks safe to the victim.
How to check if your site has it
List redirect parameters
Look for URLs with parameters like redirect, redirect_to, next, url, return, returnUrl, continue, dest or goto. Check login, logout, checkout and tracking links.
Swap in an outside address
Replace the value with a site you do not own but is harmless, such as https://example.com. Open the link in a private window.
Watch where you land
If you end up on example.com, the redirect is open. Also try //example.com and https:%2F%2Fexample.com, because filters often miss these forms.
Check headers from the command line
Use curl to see the Location header without following it.
curl -sI "https://yoursite.com/login?next=https://example.com" | grep -i '^location'How to fix it
The rule is the same everywhere: never redirect to a raw value from the URL. Accept only relative paths on your own site, or match the host against a short allowlist.
Use wp_safe_redirect
In custom code, replace wp_redirect() with wp_safe_redirect(), which only allows hosts on your site. Add extra hosts with the allowed_redirect_hosts filter.
Update plugins and themes
Open redirects often come from plugins. Update them, and remove ones that are abandoned.
Validate the target
Allow only paths that start with a single slash, or hosts from an allowlist. Reject everything else and fall back to the home page.
Prefer IDs over URLs
Where possible, pass a short key like ?next=dashboard and map it to a path on the server.
Check theme and apps
Shopify's own return_to handling restricts redirects to your store. Review theme code and installed apps that build redirect links, and remove ones that pass full URLs through.
Review custom code and 301s
Webflow has no server-side redirect parameter by default. Check custom JavaScript that reads window.location parameters and sets location.href, and use fixed 301 redirects in Site settings instead.
<?php
$target = $_GET['next'] ?? '/';
$allowed_hosts = ['yoursite.com', 'www.yoursite.com'];
$parts = parse_url($target);
$is_relative = isset($target[0]) && $target[0] === '/' && substr($target, 0, 2) !== '//' && substr($target, 0, 2) !== '/\\';
$is_allowed = isset($parts['host']) && in_array($parts['host'], $allowed_hosts, true);
if (!$is_relative && !$is_allowed) {
$target = '/';
}
header('Location: ' . $target, true, 302);
exit;const params = new URLSearchParams(window.location.search);
const next = params.get('next') || '/';
const url = new URL(next, window.location.origin);
if (url.origin === window.location.origin) {
window.location.assign(url.pathname + url.search);
} else {
window.location.assign('/');
}Open
- Any ?next= value is accepted
- Link shows your trusted domain
- Can lead to any outside site
Restricted
- Only relative paths or allowlisted hosts
- Unknown targets go to the home page
- Phishing links on your domain stop working
How to confirm it's fixed
- Repeat the test with https://example.com as the parameter and confirm you land on your own site
- Try //example.com, /\example.com and URL-encoded versions
- Check the Location header with curl
- Confirm normal flows still work: login, logout and checkout return users to the right page
- Test every parameter name you listed, not just one
How to prevent it happening again
- Add a code review rule: no redirect uses a raw request value
- Keep CMS core, themes and plugins updated
- Run a vulnerability scan after each major release
- Use a single shared redirect helper so the allowlist lives in one place
- Remove unused redirect endpoints and old tracking links
How FunnelGuard handles this
This issue is outside what FunnelGuard checks. FunnelGuard runs your real customer journeys, such as lead forms and checkouts, and checks the steps, tracking hits and test leads. It does not scan for security flaws like open redirects.
The right tool is a web vulnerability scanner (DAST) or a penetration test, which probes URL parameters with crafted destinations. Many website firewalls and security plugins also include checks. Use one of these alongside funnel monitoring.
Questions people ask
What is an open redirect vulnerability?
It is a link on your site that sends visitors to any address given in the URL, without checking it. Attackers use it so a malicious link appears to start on your trusted domain.
Why is an open redirect dangerous if it only redirects?
The link looks legitimate, so people and email filters trust it. Victims can land on fake login or payment pages and blame your brand. It can also be chained with other attacks.
How do I test my site for an open redirect?
Find URLs with parameters like next, redirect or url. Replace the value with https://example.com and see whether you end up there. Also check the Location header with curl and try //example.com.
How do I fix an open redirect?
Do not redirect to raw input. Allow only relative paths starting with a single slash, or compare the parsed host to an allowlist you control. Send everything else to your home page.
Can an open redirect get my Google Ads disapproved?
It can contribute. Ad platforms review where a click path ends, and a redirect that can lead to harmful sites may trigger a flag. Policies change, so check each platform's current rules and fix the redirect.
Is wp_redirect in WordPress an open redirect?
wp_redirect() sends to any URL you give it, so passing it unchecked input creates one. wp_safe_redirect() limits targets to your own host and any you allow with the allowed_redirect_hosts filter.
Does FunnelGuard detect open redirects?
No. FunnelGuard monitors funnel journeys, tracking and lead delivery, not security flaws. Use a vulnerability scanner or a penetration test for open redirects.