CWE-601Automation & fraudSeverity · Medium

Open redirects for phishing

A trusted login or link URL that forwards to any site in a parameter lets attackers send users through your domain to a fake page that steals logins.

At a glance

Controls
CWE-601 · A01:2021 Broken Access Control
Typical severityMedium
ReferenceCWE-601
OWASP Top 10A01: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.

  1. 01List every redirect parameter from the code and from live login and logout flows.
  2. 02Open each with an outside address controlled by MATT, and with tricky forms of it, while signed in as a test user.
  3. 03Record whether the browser leaves the product, and whether any token travels with it.
The rule, in plain English

Redirects must go only to the product’s own pages.

Executable check

as 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

  1. 01

    Accept only relative paths, or compare the full destination against a fixed allow list.

  2. 02

    Parse the address properly before comparing, so tricks with slashes and encoding fail.

  3. 03

    In OAuth and single sign‑on, register exact redirect addresses with the provider.

  4. 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? →

ExploitOps discovery call

Understand where your security loop breaks.

A call with a MATT co-founder to understand your product and whether an ExploitOps Review is worth doing. If there is a real need, we scope one with the research team.

Let’s understand your priority

What brings you to MATT?

What would you like help with?
01 / 02