Skip to content
CSRF Disclosed report

Leveraging XHR and CORS to hijack users' CSRF Token

Yassine Aboukir Follow

Originally disclosed on Mozilla

  • Fixed in 17 days
  • Paid in 41 days
  • Disclosed after 17 days
Text
What did you do?
================
HTML5 brings us Cross Origin Resource Sharing or CORS which is a mechanism that enables a web browser to perform "cross-domain" requests using the XMLHttpReques.

Every page that is supposed to be accessed by foreign sites, should respond with the ‘Access-Control-Allow-Origin' header in the HTTP Response header and specify a white list of websites that are allowed to access its content. 


What happened?
==============
MDN set the Access-Control-Allow-Origin with the wildcard '*', which means that all websites are allowed to access MDN sensitive pages.

This security vulnerability would allow any attacker to retrieve the content of each page and extract the CSRF authenticity token from the input attribute.

<input type="hidden" name="csrfmiddlewaretoken" value="">

Consequently, the attacker can easily bypass the implemented protection mecanism to easily craft a CSRF attack against MDN connected users.

Proof Of Concept :
------------------
If you are connected to your MDN account and access the following page : http://yassineaboukir.com/mozilla.html
Your CSRF token will be extracted and sent to be stored in : http://yassineaboukir.com/cookielog.txt

What should have happened?
==========================
You should review the domains which are allowed by the CORS policy in relation to any sensitive content within the application, and determine whether it is appropriate for the application to trust both the intentions and security posture of those domains. 

Is there anything else we should know?
======================================

The original report as published on Mozilla's Bugzilla, by Yassine ABOUKIR. Images and videos are our own copies; raw HTML is shown as text. View it on Mozilla's Bugzilla.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

What is known

A medium-severity CSRF bug in Security. Mozilla made it public on 2 October 2015.

About CSRF

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

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

What is CSRF?

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

More by Yassine Aboukir

View all

2 more disclosed reports, best first.

More from Mozilla

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.