Skip to content
CORS Write-up Intermediate

CORS Vulnerability with Trusted Insecure Protocols

The application's CORS configuration reflected arbitrary subdomains, allowing cross-origin requests with credentials. An attacker could exploit an XSS vulnerability in the stock check feature to make a victim's browser fetch the admin's API key and send it to an attacker-controlled server.

rcxsecurity Follow

Published on medium.com

Welcome back to another Lab Walkthrough at the Cybersec Cafe, where I give you the complete breakdown of my mindset as I approach hacking a Web Application. These writeups are from controlled environment to deep dive into the methodology to help you learn how to test applications yourself.

Ryan G. Cox, 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

Impact

An attacker could retrieve the administrator's API key, potentially leading to account takeover or unauthorized access to sensitive data.

What the attacker needed

Victim visits attacker-controlled page; attacker can host a malicious page

The fix

The CORS configuration should be fixed to only allow trusted origins, and the XSS vulnerability should be addressed.

How it was found

  1. Send the AccountDetails request to Repeater and add an Origin header with an arbitrary subdomain.
  2. Observe that the Origin is reflected in the response, confirming CORS misconfiguration.
  3. Identify that the stock check feature loads via an HTTP request to a subdomain and is vulnerable to XSS.
  4. Craft a JavaScript payload that uses the XSS to make a credentialed request to the AccountDetails endpoint and exfiltrate the response to the exploit server.
  5. Deliver the exploit to the victim and check the access log for the API key.

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 can read its data. Here, the site trusted any subdomain, so a malicious page could read private data. The attacker also found a way to run their own code on the site (XSS) and used it to steal an admin's API key.

What is CORS?

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

More by rcxsecurity

View all

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