Skip to content
CORS Write-up Beginner

Acknowledged by Microsoft — For a Bug I Almost Didn’t Report

The CORS configuration on a Microsoft domain accepted any origin whose hostname ended with the trusted suffix, so an attacker-controlled domain that merely looked similar was treated as trusted. An attacker could then make cross-origin requests with the victim's cookies and read the responses, though the report did not demonstrate a concrete data leak or dangerous action.

Harsh kothari Follow

Published on cyberhrsh.medium.com

This is the story of how Microsoft Advertising’s CORS config thought my fake domain was legit — just because it looked like it belonged.

Harsh kothari, on cyberhrsh.medium.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 server validated the Origin header with a suffix match (endsWith) instead of an exact allowlist, so any hostname ending with the trusted string was accepted.

Impact

The misconfiguration could let an attacker read responses from authenticated cross-origin requests, but the report did not show a full attack scenario or prove that user data could actually be leaked or a dangerous action performed, and Microsoft rated it Low Impact.

What the attacker needed

Attacker controls a domain ending with the trusted suffix; victim visits attacker's page while logged in

The fix

The CORS origin check should be fixed by using an exact allowlist of trusted origins rather than a suffix match.

How it was found

  1. Host a page on a domain you control.
  2. Send a cross-origin request to the Microsoft API with credentials included and a spoofed Origin header.
  3. Observe that the response reflects the fake origin and allows credentials.

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.

Websites use a rule called the Same-Origin Policy to stop one site from reading data from another site. CORS is a way for a site to say which other sites are allowed to read its data. Here the site used a loose check that accepted any address ending with its own domain name, so a lookalike domain was wrongly trusted.

What is CORS?

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

More by Harsh kothari

View all

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