Skip to content
CSRF Disclosed report Advanced CVE-2015-3115

CSRF possible when SOP Bypass/UXSS is available

The report describes how an attacker could perform CSRF attacks against HackerOne if they can read content from the site (via SOP bypass or UXSS), because CSRF tokens are printed in HTML, not bound per action, and PATCH/DELETE can be sent via _method. The attack scenario uses a UXSS bug in IE to frame a CloudFlare endpoint without X-Frame-Options, extract the token via AJAX, and then submit a forged request.

Mathias Karlsson Follow

Originally disclosed on HackerOne

Bounty$2,500 View original
  • Triaged in 21 hours
  • Fixed in 2 days
  • Paid in 16 days
  • Disclosed after 24 days

Description If an attacker could extract content from https://hackerone.com, they could perform CSRF attacks due to the fact that:

  1. Some pages prints the token in the HTML response (edit user form at https://hackerone.com/settings/profile/edit)
  2. Tokens aren't bound per action
  3. PATCH/DELETE can be sent via _method

Attacker being allowed to read content but not execute JS could happen if:

  1. SOP Bypass in plugin (http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-3115)
  2. SOP Bypass in application design (https://miki.it/blog/2014/7/8/abusing-jsonp-with-rosetta-flash/)
  3. UXSS (https://blog.innerht.ml/ie-uxss/)

Currently, some mitigations are in place. _method isn't allowed in GET and the Origin header is checked. This isn't enough since FireFox and IE doesn't send Origin header when submitting forms.

Attack scenario The most recent (to my knowledge) SOP bypass was the re-implementation of the IE UXSS bug (https://blog.innerht.ml/ie-uxss/). This was working November 28th 2015. However, the bug required framing at least one resource, and HackerOne sends X-Frame-Options on all resources. Sadly, HackerOne uses CloudFlare so the URL https://hackerone.com/cdn-cgi/trace could be used (doesn't send X-Frame-Options).

So to sum up:

  1. Logged in user visits attackers page in IE (vulnerable to UXSS)
  2. UXSS runs script on framed "https://hackerone.com/cdn-cgi/trace" to extract CSRF token on https://hackerone.com/settings/profile/edit (via AJAX)
  3. User is attacked with the extracted CSRF token

Fix This could be mitigated by storing the token in JavaScript and adding the token to the form after the page is loaded.

Attachments

example.png
example.png From the original on HackerOne

The original report as published on HackerOne, by avlidienbrunn. 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 CSRF token is embedded in the HTML of some pages and is not tied to a specific action, so if an attacker can read the page content (e.g., via a browser SOP bypass), they can reuse the token for other state-changing requests.

Impact

An attacker could perform CSRF attacks, such as changing the user's profile, if they can read content from HackerOne via a SOP bypass or UXSS; however, the attack requires a vulnerable browser and the specific UXSS bug was working as of November 28th 2015.

What the attacker needed

Victim uses a browser with SOP bypass or UXSS; victim is logged in to HackerOne; victim visits attacker's page

The fix

The token should be stored in JavaScript and added to the form after the page loads, so it is not present in the HTML.

How it was found

  1. Logged in user visits attacker's page in IE (vulnerable to UXSS)
  2. UXSS runs script on framed "https://hackerone.com/cdn-cgi/trace" to extract CSRF token on https://hackerone.com/settings/profile/edit (via AJAX)
  3. User is attacked with the extracted CSRF token

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.

CSRF is when a malicious site makes your browser send a request to another site where you are logged in, without your knowledge. Normally, a secret token in each form prevents this, but here the token could be stolen if the attacker can read the page's content using a browser bug. The report suggests hiding the token in JavaScript so it is not in the HTML.

What is CSRF?

Another site makes a signed-in user's browser perform an action they did not intend.

More by Mathias Karlsson

View all

7 more disclosed reports, best first.

More from HackerOne

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site request forgery (CSRF)

The lesson behind this report.

Another site makes a signed-in user's browser perform an action they did not intend.