===========================================================================
Web application vulnerabilities in context of browser extensions - 2: Opera
===========================================================================
.. |date| date::
:Authors: Taras Ivashchenko
:Contact: http://oxdef.info
:Date: |date|
:Copyright: This work is licensed under a `Creative Commons Attribution-Share Alike 3.0 Unported License
"+ lang.popup_to + " " +
event.data.msg[i].sendermail + "
" +
lang.popup_from + " " + event.data.msg[i].authormail +
"
" + event.data.msg[i].summary + "
" var msg = $('').addClass('message').attr("title", tooltip).tooltip({ left: -15 }) .html("" + event.data.msg[i].authorname + " : " + event.data.msg[i].title).click({ link: event.data.msg[i].link }, LoadLink); $('#message_box').append(msg); ... Typical injection point in such cases is popup window (same in Google Chrome) because usually content of this window is made by background page using input data (e.g. RSS feeds or e-mail). But, IMHO, it can be possible in case of processing input JSON data to use dangerous constructions for that, e.g. JavaScript function `eval` like: :: var msg = eval("(" + response_text + ")"); instead of :: var msg = JSON.parse(response_text); In such scenario malicious playloada will be executed in context of background page. Target data ~~~~~~~~~~ One of the most popular aims of XSS is stealing of private data (e.g. auth data). At current moment Opera does not allows extensions to access browser cookie (each extension has separated cookie storage). So following data may be interesting for malicious man through XSS attack: * current extension cookies (in very big number of social site extension it is auth data); * widget.preferences data - for example, there are username and password in `Reddit Envelope`_ extension preferences * context data - in our example with Google Notifier it can be letters data (sender, subject) * phishing - even in limited context malicious man can use this hole to phish users .. figure:: http://oxdef.info/papers/ext/img/xss_phishing.png Phishing attack vector .. _Reddit Envelope: https://addons.opera.com/addons/extensions/details/reddit-envelope/1.2.1/ How to transfer data ~~~~~~~~~~~~~~~~~~~ Usually it can be made using "sniffer script" - in payload malicious man simple gets sniffer URL with dumped data as parameter. In our case by default it is not trivial: In the default policy, a user agent must deny access to network resources external to the widget by default, whether this access is requested through APIs (e.g. XMLHttpRequest) or through markup (e.g. iframe, script, img). [#]_ Tested extension has in config file following access_ rules: :: ...