UTF-7 Universal XSS by overriding document charset using <object> type attribute
Originally disclosed on Mozilla
- Fixed in 4 days
- Paid in 3.0 years
- Disclosed after 4 days
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.99 Safari/533.4
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6 ( .NET CLR 3.5.30729)
In Firefox, the "type" attribute of an <object> tag can override the charset of a framed HTML document, even if the document is included across origins. The charset specified in the "type" attribute overrides any charset of the document that is specified using <?xml encoding="utf-8"?>, <meta charset="utf-8">, or <meta http-equiv="Content-Type" value="text/html;charset=utf-8">. This allows an attacker to bypass server XSS filtering of angle brackets and inject arbitrary JavaScript code encoded in UTF-7 into web sites. It works on web sites that do not specify a charset in the Content-Type header (416 out of the Alexa top 1000). It does not work on web sites that specify a charset in the Content-Type header (584 out of the Alexa top 1000).
Reproducible: Always
Steps to Reproduce:
Here's a proof of concept exploit, using bankofthewest.com as an example:
<object type="text/html; charset=UTF-7" data="https://srch01.bankofthewest.com/search?q=%2BACI-%2BAD4-%2BADw-script%2BAD4-alert(document.location)%2BADw-/script%2BAD4-"></object>
Actual Results:
Bank of the West attempts to set the charset using a meta tag, but Firefox ignores it and parses the response document as UTF-7. The exploit is successful.
Expected Results:
Firefox should not let the "type" attribute of a cross-origin <object> tag influence the charset of the rendered object.
See also: bug 356280, bug 406777, bug 408457, bug 530647, bug 414064
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 XSS bug in DOM: Core & HTML. Mozilla made it public on 23 July 2010 as CVE-2010-2768.
About XSS
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.