Skip to content
OAuth / SSO Disclosed report Intermediate

Redirect on authorization allows account compromise

The redirect_uri validation in the OpenID Connect authorize endpoint incorrectly accepted hostnames that began with a valid hostname, such as a subdomain of an attacker-controlled domain. An attacker could redirect a user to a malicious site and compromise their Login.gov token without user interaction beyond the redirect.

cablej_dds Follow

Originally disclosed on HackerOne

Critical View original
  • Triaged in 4 days
  • Fixed in 3 months
  • Disclosed after 4 months

Summary by the program

Login.gov had a bug in validating the redirect_uri in the /openid_connect/authorize endpoint, which allowed specially crafted subdomains to be incorrectly validated when they began with a valid hostname. For example, a redirect_uri with a hostname of agency.gov.example.com would validate a URL as if it were presented as agency.gov.

This enabled an attacker to compromise user sessions on sites that integrated with login.gov. No user interaction was required other than the user being redirected to a URL.

Login.gov immediately patched this bug by making validation of the redirect_uri significantly stricter by enforcing an exact match of the hostname. Shortly after, Login.gov worked with agency partners to identify every full URL that agency service providers (SPs) would need to register, and then implemented exact matching for the entire redirect_uri (including the URL path).

Summary by the researcher

An error in parsing redirect urls during the authorization flow allowed an attacker to compromise a user's Login.gov token by redirecting users to a malicious site. Props to the TTS team for quickly issuing a patch after the report!

Ineligible for bounty due to government employment.

The original report as published on HackerOne, by cablej_dds. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the redirect_uri validation used a prefix or substring match on the hostname instead of an exact match, so a hostname like agency.gov.example.com was treated as agency.gov.

Impact

An attacker could compromise user sessions on sites that integrated with Login.gov, with no user interaction other than being redirected to a URL.

What the attacker needed

Victim is redirected to a crafted URL; attacker controls a domain

The fix

It was fixed by enforcing an exact match of the hostname and later the entire redirect_uri including the path.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

When you log in using another service like Login.gov, that service sends you back to the website you came from using a 'redirect' address. The bug was that Login.gov checked this address too loosely, so an attacker could give an address that looked like the real one but actually belonged to them. This let the attacker steal the login token and take over the user's session.

What is OAuth / SSO?

Mistakes in OAuth, OpenID Connect, SAML or token handling that leak codes and tokens or link an attacker's identity to a victim's account.

More by cablej_dds

View all

8 more disclosed reports, best first.

More from GSA Bounty

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

OAuth and single sign-on flaws

The lesson behind this report.

Mistakes in OAuth, OpenID Connect, SAML or token handling that leak codes and tokens or link an attacker's identity to a victim's account.