Friday, March 15, 2013

XSSI in Zendesk leaked Twitter users' personal information

TL;DR Chaining a XSSI vulnerability in Zendesk and authorization issue in Twitter to access Twitter users' username and email address.

What is Cross-Site script inclusion vulnerability?
Browsers prevent pages of one domain from reading pages in other domains. But they do not prevent pages of a domain from referencing resources in other domains. In particular, they allow images to be rendered from other domains and scripts to be executed from other domains. An included script doesn't have its own security context. It runs in the security context of the page that included it. For example, if includes a script hosted on then that script runs in the evil context not in the google context. So any user data in that script will "leak" [1].

Another definition:
A flaw caused by the failure to secure sensitive JSON-like responses against being loaded on third-party sites via <script src=...>. User-specific information in the response may be leaked to attackers [2].

Detail of XSSI vulnerability:
Zendesk used a JavaScript file ( to store information of currently logged-in user. The most interesting data in this file was username and email address. It was possible to include this JavaScript file in a evil page, redirect user to evil page and access these information.

Authorization issue in Twitter!?:
Twitter authorize to access part of user data without any user interaction (I don't know why this should happen silently). So is it a security issue? In my opinion it totally depends on what Twitter shares with Zendesk! Based on data in user.js file only Twitter users' username and email address are shared with Zendesk (Without user perimission). These are interesting but I think this is not a security issue or at least its impact is low. 

What happens when user request

Chaining these issues:
As Twitter share users' info with Zendesk, vulnerabilities (XSS, XSSI, ...) in Zendesk could leak these data. To ensure that user is currently logged into we force user's browser to send a request to

1) Load in a hidden iframe in evil page.
2) With a delay load in script tag.


function loadme()
 address = ['',
 for(var i=0;i<5;i++)
  var tag=document.createElement('script'); 
<iframe src="" frameborder="0" width="1" height="1" onload="loadme()"></iframe>

PoC Video:
At that point I've prepared a quick PoC [3] and assumed that victim was logged into

Response from Twitter and Zendesk: 
At first I've reported this issue to Twitter security, But they believed hat wasn't related to Twitter and Zendesk should fix this issue. It's obvious that who should fix the XSSI but as I mentioned Twitter authorize Zendesk to access users' data without any user interaction! 
Response from Twitter Security to this issue
Then I reported this issue to Zendesk support team. It seems they fixed this issue now.

Response from Zendesk to this issue
[2] Zalewski. M, The Tangled Web: A Guide to Securing Modern Web Applications, 262.

No comments:

Post a Comment