Cross origin restriction bypass with Fetch API
Originally disclosed on Mozilla
- Fixed in 3 days
- Paid in 5 days
- Disclosed after 3 days
Created attachment 8602559
Capture.PNG
User Agent: Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2383.0 Safari/537.36
Steps to reproduce:
1) Open Fiddler web debugger and enable "Decrypt HTTPS Traffic" option
2) Launch https://mallory.csrf.jp/fetch/request.html
3) See the request packet sent from the 2) by Fiddler
Actual results:
Fetch API doesn't restrict request header names to be set.
In this scenario, the request shown in 3) has invalid Host and Cookie headers to the other origin, csrf.jp, and the response data has come from https://csrf.jp/index.html.
fetch("/index.html", {
method: "GET",
headers: {
"Host": 'csrf.jp',
"Cookie": "Arbitorary Values"
}
})
Expected results:
Fetch API should restrict header names that can be set (see the attached image).
For example, Host, Cookie and sec-* headers should be ignored.
The implementation of XmlHttpRequest.setRequestHeader would be a good reference.
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 high-severity security bug in DOM: Core & HTML. Mozilla made it public on 9 May 2015.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.