Skip to content
CORS Write-up Intermediate

How One Small Misconfiguration Led To A Critical Finding

A staging subdomain had a CORS policy that reflected any origin containing the string 'target.com' and allowed credentials, so an attacker-controlled domain like target.com.attacker-domain.com was trusted. An attacker could read authenticated API responses cross-origin, exposing session data, internal analytics and sensitive account information.

Fateyaly Follow

Published on systemweakness.com

Read here.

Fateyaly, on systemweakness.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

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

How it worked

Root cause

Likely the backend validated the Origin header with a substring match instead of an exact allow-list, and combined that with credentialed CORS.

Impact

An attacker could read authenticated API responses cross-origin, including session data, internal analytics and sensitive account information.

What the attacker needed

Victim visits attacker page while logged in; attacker controls a lookalike domain; staging subdomain reachable

How it was found

  1. Run subdomain enumeration and technology detection against the target.
  2. Notice one subdomain returning a staging environment header and a wildcard CORS origin.
  3. Observe that the frontend calls APIs directly from the browser, so the backend trusts browser requests.
  4. Replay requests through a proxy and see credentials allowed with a wildcard origin pattern.
  5. Introduce a crafted subdomain into the request flow and receive a successful response.
  6. Confirm that authenticated API responses are readable cross-origin.

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 write-up has not been written yet. The Original tab links to the source.

CORS is a browser rule that lets a website say which other sites may read its responses. This site used a loose check: if the requesting site's address merely contained 'target.com', it was allowed, and cookies were sent too. So a lookalike address controlled by an attacker could read private data from the logged-in user's session.

What is CORS?

A permissive cross-origin policy lets another site read responses with the user's credentials.

More by Fateyaly

View all

9 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

CORS misconfiguration

The lesson behind this report.

A permissive cross-origin policy lets another site read responses with the user's credentials.