Referrers/origins broken and spoofable via cross-window location manipulation
Originally disclosed on Mozilla
- Fixed in 3 months
- Paid in 2.9 years
- Disclosed after 3 months
http://hg.mozilla.org/mozilla-central/diff/a2f468118868/dom/base/nsLocation.cpp (from bug 500328) causes the referer for location changes to always be the URI of the current (before change) location.
This is a big departure from previous behavior, where the referrer used to be set to the URI of the principal for the initiating content script: generally, if the load happens cross-window (e.g. a parent frame sets the location on an inner frame or vice-versa), this URI is different from the current location. Furthermore, the URI set here gets passed later as the aRequestLocation to nsIContentPolicy::shouldLoad() implementations, which regard it as the origin of the load, and possibly cascades elsewhere (CSP?) where security or privacy checks are made.
I hope HTML 5 does not dictate this new behavior, because it doesn't just cause empty frames, initialized with "about:blank", not to send out any Referer header when they're first loaded with a HTTP URL by setting their contentWindow.location, but, much worse, it can be exploited for arbitrary referrer spoofing.
At any rate please let the chrome clients at least (content policies, mostly) keep receiving the old info (i.e. the URI of the window hosting the script which initiated the load) which is otherwise not easy to retrieve, especially for JavaScript implementers, and can have privacy and security implications.
I'm setting the security bit because NoScript could be tricked by this bug into wrong ABE and XSS filtering decisions, and I don't know whether CSP, CORS or other security features which check the request origin are vulnerable.
For sure I can tell this bug can be used to work-around the XPI installing whitelist, as exemplified here: http://evil.hackademix.net/test/fx4frames/
The same page shows how this bug can be exploited to cause cross-site information leakages (in the example, to know whether the user is logged or not in AMO) by forcing an informative redirected URL to be used as the referrer for a sniffing web page.
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 security bug in DOM: Navigation. Mozilla made it public on 15 December 2010.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.