At a glance
- Controls
- CWE-601 · A01:2021 Broken Access Control
What it is
Login and logout pages often take a parameter that says where to send the user next. If the product forwards to any address in that parameter, its own trusted domain becomes a launch point. The user sees a real link and lands somewhere else.
Attackers send phishing emails with links that start on the real product domain. Users trust the link, then land on a copy of the login page and enter their password. In sign-in flows that pass tokens, an open redirect can also leak those tokens to the attacker. AI-assisted attackers test common redirect parameter names across a site in bulk.
Where it hides
What a reviewer can look for in the code and in the behaviour, before anyone proves it.
- Parameters such as next, returnUrl, redirect or continue on login and logout pages
- Single sign-on and OAuth callback flows
- Email link tracking and click-through endpoints
- Checks that only test whether the address starts with or contains the product domain
How MATT tests it
The proof runs against the deployed product, on every release, whoever wrote the code.
- 01List every redirect parameter from the code and from live login and logout flows.
- 02Open each with an outside address controlled by MATT, and with tricky forms of it, while signed in as a test user.
- 03Record whether the browser leaves the product, and whether any token travels with it.
Redirects must go only to the product’s own pages.
Executable checkas anyone: GET /login?next=https://outside.example expect: redirect to a product page, or an error expect: the same for //outside.example and encoded forms expect: no token or code in any outside address
Every rule MATT holds →What the fix looks like
- 01
Accept only relative paths, or compare the full destination against a fixed allow list.
- 02
Parse the address properly before comparing, so tricks with slashes and encoding fail.
- 03
In OAuth and single sign‑on, register exact redirect addresses with the provider.
- 04
Show an interstitial page before sending users to any outside site.
A check that was never written is found by proving the deployed behaviour, fixed with the engineer who shipped it, and kept fixed by running the control on every change. What is ExploitOps? →