Check your return links for an open redirect vulnerability
An open redirect accepts a destination from a visitor without checking that it's allowed. An attacker can use a link that starts with your domain to send someone to a phishing page. Review return links in sign-in flows and anywhere else a request chooses the next destination.
SiteCMD runs this check after you prove the site is yours, starting with the first scan after proof.
Fix an open redirect vulnerability with approved destinations
- 1
Use a fixed destination when the flow allows it
Remove the destination parameter if everyone should land on the same page. If you need several destinations, map a short identifier to an approved address on the server.
- 2
Check the destination when a full address is necessary
Use a maintained URL parser. Compare the parsed scheme, host and port with the destinations you allow, and limit the path when the flow needs a specific endpoint.
- 3
Reject lookalike and unexpected destinations
Don't rely on a raw starts-with or ends-with test. Use the validated destination for the redirect, and check that unapproved inputs can't select another site.
Review open redirects in project code as well as live links
The SiteCMD CLI can flag redirects built from user input in project code. Review the validation around each finding to decide which destinations your app should accept.
Frequently asked questions
Is every redirect to another site an open redirect?
No. The problem is letting untrusted input choose a destination the app didn't intend to allow. A fixed, approved external destination serves a different purpose.
Review cross-site access alongside redirect validation
Website security
Catch leaked API keys and exposed files before someone uses them against you.
CORS
Review cross-site read permissions without opening private responses to every origin.
Redirects
Choose the right redirect for a move and remove unnecessary steps to the destination.