navigator.sendBeacon ignores Access-Control-* headers and 4xx status code in a response of preflight
Originally disclosed on Mozilla
- Fixed in 5 days
- Paid in 5 days
- Disclosed after 5 days
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.33 Safari/537.36
Steps to reproduce:
1. Send a cross-origin non-simple request by navigator.sendBeacon.
2. In order to reject an unexpected cross-origin request, the server returns
- 4xx status code (e.g. 400 Bad Request)
- Access-Control-Allow-Methods: GET (because a method of sendBeacon is always POST)
- Access-Control-Allow-Origin: http://other-origin
as a response of preflight request.
Live demo is here: http://mallory.csrf.jp/beacon/40x.html
Actual results:
Nightly 44 ignores above 3 blocks, and an actual non-simple request is finally sent to the server.
Expected results:
An actual non-simple request should not be sent.
Note that the latest Firefox stable release (41.0) works correctly but Nightly doesn't.
There may be regression of CORS handling in Nightly (44.0).
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: Security. Mozilla made it public on 28 September 2015.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.