Skip to content
CORS Write-up Intermediate

How an “Out-of-Scope” XSS Led to a 300 CHF Bounty

A WordPress REST API endpoint reflected arbitrary origins in its CORS headers while allowing credentials, and a reflected XSS on a related out-of-scope domain provided the JavaScript execution context needed to exploit it. An attacker could steal authenticated users' profile data, including roles, by luring a logged-in victim to a crafted link.

asifebrahim580 Follow

Published on medium.com

Together, they formed a complete cross-origin authenticated data-theft chain capable of extracting private user information from logged-in users.

Asif Ebrahim, on 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

The API reflected any Origin header in Access-Control-Allow-Origin while setting Access-Control-Allow-Credentials to true, and a related domain had a reflected XSS that supplied the execution context.

Impact

An attacker could steal authenticated users' profile data, including names, email addresses, roles and capabilities, and identify administrator accounts for further attacks.

What the attacker needed

Victim is logged in to the API domain; victim clicks a crafted link; XSS on a related domain

How it was found

  1. Send a request to the users/me endpoint with a fake Origin header and observe the reflected origin and credentials allowance.
  2. Find a reflected XSS in the PAGEID parameter on the related event domain.
  3. Craft a link on the event domain that triggers the XSS and calls window.stop() to halt the logout redirect.
  4. Have an authenticated victim open the link so the script fetches the users/me endpoint with credentials and reads the response.

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 websites may read its responses. This site said 'any website' and also allowed logged-in cookies to be sent, so any script running on a trusted domain could read private data. A separate cross-site scripting (XSS) flaw on a related domain gave attackers a place to run that script.

What is CORS?

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

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.