Hacker News new | comments | show | ask | jobs | submit login
Dropbox authentication: insecure by design (dereknewton.com)
162 points by trotsky on Apr 7, 2011 | hide | past | web | favorite | 60 comments



Sort of alarmist, if I understand it.†

The root of his concern is that Dropbox is vulnerable to local attackers. There is little Dropbox could reasonably do to meaningfully change this††. The Dropbox client needs to be able to authenticate itself to the Dropbox server as the price of entry to make Dropbox work. The Dropbox client is usually always running, and is in any case often running. While it's running, anything it did to prevent attackers from stealing authenticators could be circumvented by attacking the running Dropbox process.

If you think about it, this is a problem essentially shared by Google, and your bank. It is fair to critique the application for not making it even easier to revoke access to all but your current authorized machines (in other words, to make rekeying understandable and simple). But it's a UX issue, not a fundamental security problem.

I may not; I'm going from 'trotsky's mirror.

†† Irony, based on previous comments from me today, noted.


Well, it's a stored authentication token mechanism, which is the same as is used by many other client-side software. However, there are two possible ways to improve the authentication:

- use a second factor in the authentication, such as the MAC address of the primary NIC in the machine

- limit the time that the token is valid by getting the client to periodically get a new token from the server. This prevents two clients using the same token indefinitely without detection.

Both these would be good improvements to the security of the host_id data that Dropbox uses for authentication.


A system can easily be set up to lie about its MAC address, and you can't hide the legitimate MAC address. It's a very bad secret value.

The only thing you can do, without entering the reverse engineering arms race, is to add a real second-factor key to the equation --- meaning, something a user has to remember or read off a fob. And in fact, only the fob helps you here, since malware can (and does, every day, in bank fraud trojans) capture any secret you enter.

I agree that it would be better for security if Dropbox made rekeying happen more, but they can do the cost-benefit better than I can here.


Apple has solved this pretty elegantly using just the machine id. When you purchase an app on the appstore apple creates a receipt that contains a hash of your machine id as well as other meta data. The receipt is then signed with Apples certificate.

When you launch an app you verify the receipt was signed by Apple and that the hash of the current machine id matches the hash of the machine id in the receipt.

Dropbox could generate the same sort of receipt serverside when you first sign in. From then on each time the dropbox client launches it just validates the receipt against the current machine.


This works because Apple is in the reversing arms race. Does it make sense for Dropbox to go down this path? Note that Google and your bank don't.


Banks absolutely do this once they have the ability to talk to the OS. I've built 3 banking apps for iphone/ipad now and client side verification was involved in all of them after first login.

The problem is browsers just don't have a good standard way of accomplishing this.


All my banks do. If they detect a browser/IP that I haven't used before they ask me for another piece of authentication (secret question)


I think we're talking past each other here. I thought we were talking about embedding secrets in machines. If you want a button in the Dropbox UI that tells it to freak out when your IP changes, that's fine; I think there's a good reason Gmail doesn't default that way though.


Blizzard freaks out about changing IP addresses when you sign in to World of Warcraft. I have two internet connections at home and sometimes I switch back and forth, and back when I was playing WoW, it would lock me out after each switch. I had to login to my account via the battle.net website and stell it that everything was ok.

It was extremely annoying. The last few times it happened I just didn't play for a while because I didn't want to bother with reauthenticating; that's when I realized that I didn't enjoy the game that much any more and cancelled my account.


for the sake of counter-example: facebook does. E.g. if you try to log in from a different country than ones it already knows you have to go through a long process of reauthentication by inputting your friends' names based on pictures. At least, it happened to me twice.


Again, the machine ID is easily faked by an attacker.


Yes, systems can definitely fake any ID you attempt to use: MAC addresses, machine IDs, hostnames, etc. Attackers can intercept rekey attempts and clone the new key on their systems. But arguing that these improvements shouldn't be done because they don't totally close every security vulnerability in a system is an example of Perfect Solution fallacy [1]. Just because security cannot be perfect doesn't mean that steps to improve it shouldn't be taken.

The advantage of rekeying or secondary verification of the client is that it addresses the kind of attack where you can simply copy this metadata and have enough information to remotely compromise the Dropbox data later. As you say, whether that is worth fixing is up to Dropbox to do a cost-benefit analysis. But I hope they wouldn't discard the chance to improve their security simply because a perfectly secure system isn't possible.

[1] http://en.wikipedia.org/wiki/Nirvana_fallacy#Perfect_Solutio...


> The only thing you can do [...]

Or you could build a trusted end point. Otherwise even two factor auth is only palliative. (But yes: cost-benefit, I hear you).

http://www.businesscomputingworld.co.uk/two-factor-authentic...


In addition to MAC address use adding no real security it would get in the way of running Dropbox on a flash drive, which works even if not ideally.


Keep in mind here "not ideally" includes "you lose your flashdrive, then whoever finds it has full and ongoing access to your Dropbox account".

That's kind of a worry.


Ongoing? I can still use the website to delete the host whose host ID is on the flash drive.


So long as you realised... From FTA:

"Taking the config.db file, copying it onto another system (you may need to modify the dropbox_path, to a valid path), and then starting the Dropbox client immediately joins that system into the synchronization group without notifying the authorized user, prompting for credentials, or even getting added to the list of linked devices within your Dropbox account (even though the new system has a completely different name) – this appears to be by design."


Of course I assume that I eventually notice the theft of a USB stick on which I put enough information for Dropbox to sync my entire tree. Does the article say that I can't revoke a machine's access via the web interface once the config.db for that machine has been copied?


They could make the token derived from user's password (e.g. Hash(host_id + Hash(password))), so when password changes, all existing tokens are invalidated.


We haven't looked at Dropbox professionally; if tokens are valid after password changes, we'd flag that. I'm don't know enough about Dropbox to say whether they do or don't.

(I have Dropbox on my personal machine but not my work machine).


The article says that changing passwords doesn't help: "Additionally, the host_id is still valid even after the user changes their Dropbox password (thus a standard remediation step of changing credentials does not resolve this issue)."


So, if my password is compromised (or I just routinely change it after some self-defined "expiry date"), I have to visit all my devices and reauthenticate them?

I believe this is counter-intuitive and inconvenient. If some of my devices (tokens) are compromised, I'd just go to Dropbox web interface and revoke their tokens.


Normal people assume that if their account is compromised, the appropriate countermeasure is to change their password and get on with your life. Is Dropbox a tool for normal people or for people who geek out on device authentication?


So, in proposed scheme, they change the password and everything goes out of sync.

The proper and perfectly intuitive way is to not think what users'll assume. Just add a checkbox "also, unlink all my devices" on the very password change page.


Another, rather extreme, option would be to support hardware security devices that can store PKI private keys and perform asymmetric encryption within the device (i.e. there is no way to read the private key) e.g.

http://www.safenet-inc.com/products/data-protection/two-fact...

This would provide a pretty good additional "something you have" authentication factor.


Whilst the system software is vulnerable this doesn't gain a lot (you're in Thomas' arms race): malware intercepts the transaction request and requests "please scan your fingerprint to sign transaction of $1"... then quietly presents a $1000 charge to be signed by the PKI token. Even TPM can't help if the software is hacked.


An easier way to detect something fishy would be to allow at most one connection per auth token, and invalidate it and re-request login credentials if a collision occurs. Just ping both connections first to make sure they're both actually alive, and not the same machine logging in again after a reboot-after-crash.


Hypothetically, dropbox could install on the system a second, isolated authentication process, which generates a keypair for that machine, and hides it somewhere with an ACL that does not allow the normal user direct access. Then, upon login, the dropbox client asks the auth process to sign a nonce to login.

This would mitigate the problem to an extent; an attacker then wouldn't be able to succeed with just the user's data, they'd need to get administrative access to extract the authentication keypair as well. It would, however, require administrative access to install the authentication agent program, unless there's a suitable blind keystore in the OS already.


I like the idea from a technical point of view, but I doubt it would make much of a difference in practice, because most home users log in with administrator accounts anyway. So do most developers. Only the rare, security-conscious power user would typically log on with a restricted account and even then.


Only Windows users or developers regularly login with administrator access.


I think those saying "this is a minor issue" are downplaying the problem here. Imagine your co-worker gets up for a 2 minute bathroom break (or you had 2 minutes in the boss' office alone, or at an associates house, etc) - what could you do in 2 minutes? Sure you could try to install a keylogger but this requires some knowledge, prior preparation and is susceptible to detection. You could copy off his private work but this is slow, not much you copy in 2 minutes.

Knowing this security hole, within seconds i could easily copy one small file (or upload it to crate, or just write down the machine hash or upload it to codepaste etc etc) and know i now have all his private files - for life - and not just files now but all future possible files (or at least until he changes his password; but how many people really do that regularly?).

Checking that 2 machines aren't using the same key would at least notify you that something had happened, although it may occur too late to secure your existing files.

Another option is tie the key with your IP address, and when a new IP address is detecting you need to enter in your credentials to get a new pass.

I think at least some hashing with create a unique computer stamp (username, OS version, mac address, processor hardware name, etc) would go a long way in making this more secure; it's not perfect (these things can be faked), but it certainly stops Johnny Amateur Hacker in gaining access to his friends/co-workers/bosses private files.


I'm sorry but I completely disagree.

Even in this contrived scenario where there's an opportunistic amateur attacker with full access to your computer but only for two minutes, any changes to Dropbox client security only marginally improve your situation. I've got a USB 3.0 flash drive on my keychain that could grab about 6GB in two minutes. How much secret data you got there anyway?

And as a naive attacker, I would probably just but a $40 hardware keylogger if I wanted to steal a coworker's data.

As for tying the key to IP, it adds only some security (doesn't help in your example where your coworker likely shares the same IP) and, moreover, it's a customer support nightmare. Trust me, I tried it once. Some people have IP addresses that change very often. You can't have them re-entering a password with every request.


Lock your PC.


There should never be an expectation that your data is secure on Dropbox unless you use local encryption/decryption. Your data is sent to the dropbox server where it is encrypted by their server (according to their web site) and stored. They secure the data in transit, and then again for storage, but they have access to the keys. There seems to be strong evidence that some checking is done before file transfer to see if the file you are syncing is already available somewhere on the server, and if so the file is not transferred, but does appear sync'd in your account. I noticed this personally when I placed the Access2007 Runtime installer into a folder and the 52MB file was nearly instantaneously flagged as synced. Insecure authentication of an insecure system is not really a big deal. The lack of convenience for users if stronger authentication was used is probably a bigger concern. If I have access to your local machine such that I can extract your local credential, I would easily copy all of the existing data from that machine, and could install a key logger to catch your password.


I use EncFS, a FUSE plugin, to store slightly-more-sensitive data and access it from MacOS and Linux. Works for me.


So, it's equivalent to nabbing someone's session by capturing their cookie.

Problematic, but not horrifying - unless you think we shouldn't use cookies either. Though absolutely, changing the password should invalidate the old one. Without that, theres no way to stop the use of a distributed file.


It's even less than that, as with dropbox you cannot 'capture' someones cookie using firesheep or a sniffer, as they use TLS. The only way to steal the key is by hacking into someones computer and copying it.

Dropbox is doing nothing wrong here. All computer security suffers from this issue. When your machine is compromised, security is toast and you better damn fast change all your passwords/ssh keys/...

No amount of security by obscurity will change this basic fact. The article is extremely alarmist and really doesn't tell anything new.


Well, I would argue that they are doing something wrong.

You're absolutely right to say that there is no reason to do something other then just storing the key locally (since someone who has local access to the key, can presumably access your entire dropbox already anyway). But as the original author points out, the fact that changing your dropbox password does not invalidate existing tokens is an issue.


Agreed. Limiting key lifetime in that way is an essential feature that improves security.

But the title is worded like he found a structural security hole, that's simply inflammatory and annoyed me.


I think you stop use of it by removing the original host from Dropbox Website > Account > My Computers.


Which only works until they associate it with another computer, at which point you have to do it all over again.


Dereknewton.com's Blog:

Improperly cached by design. :)

But seriously, anyone got a mirror? Definitely curious to read this.


Google seems to have it, in case you want to see it with the original formatting, etc:

Full (seems to be timing out): http://webcache.googleusercontent.com/search?&q=cache%3A...

Text-only: http://webcache.googleusercontent.com/search?&q=cache%3A...


EDIT: Original is up. Read it there, I didn't do a very good job with the formatting.

You may be able to see it in all of its html glory on http://dereknewton.com.nyud.net/2011/04/dropbox-authenticati... if you wait for a considerable amount of time for something to time out.

Dropbox authentication: insecure by design

For the past several days I have been focused on understanding the inner workings of several of the popular file synchronization tools with the purpose of finding useful forensics-related artifacts that may be left on a system as a result of using these tools. Given the prevalence of Dropbox, I decided that it would be one of the first synchronization tools that I would analyze, and while working to better understand it I came across some interesting security related findings. The basis for this finding has actually been briefly discussed in a number of forum posts in Dropbox’s official forum (here and here), but it doesn’t quite seem that people understand the significance of the way Dropbox is handling authentication. So, I’m taking a brief break in my forensics-artifacts research, to try to shed some light about what appears to be going on from an authentication standpoint and the significant security implications that the present implementation of Dropbox brings to the table.

To fully understand the security implications, you need to understand how Dropbox works (for those of you that aren’t familiar with what Dropbox is – a brief feature primer can be found on their official website). Dropbox’s primary feature is the ability to sync files across systems and devices that you own, automatically. In order to support this syncing process, a client (the Dropbox client) is installed on a system that you wish to participate in this synchronization. At the end of the installation process the user is prompted to enter their Dropbox credentials (or create a new account) and then the Dropbox folder on your local system syncs up with the Dropbox “cloud.” The client runs constantly looking for new changes locally in your designated Dropbox folder and/or in the cloud and syncs as required; there are versions that support a number of operating systems (Windows, Mac, and Linux) as well as a number of portable devices (iOS, Android, etc). However, given my research is focusing on the use of Dropbox on a Windows system, the information I’ll be providing is Windows specific (but should be applicable on any platform).

Under Windows, Dropbox stores configuration data, file/directory listings, hashes, etc in a number of SQLite database files located in %APPDATA%\Dropbox. We’re going to focus on the primary database relating to the client configuration: config.db. Opening config.db with your favorite SQLite DB tool will show you that there is only one table contained in the database (config) with a number of rows, which the Dropbox client references to get its settings. I’m going to focus on the following rows of interest:

email: this is the account holder’s email address. Surprisingly, this does not appear to be used as part of the authentication process and can be changed to any value (formatted like an email address) without any ill-effects. dropbox_path: defines where the root of Dropbox’s synchronized folder is on the system that the client is running on. host_id: assigned to the system after initial authentication is performed, post-install. Does not appear to change over time. After some testing (modification of data within the config table, etc) it became clear that the Dropbox client uses only the host_id to authenticate. Here’s the problem: the config.db file is completely portable and is not tied to the system in any way. This means that if you gain access to a person’s config.db file (or just the host_id), you gain complete access to the person’s Dropbox until such time that the person removes the host from the list of linked devices via the Dropbox web interface. Taking the config.db file, copying it onto another system (you may need to modify the dropbox_path, to a valid path), and then starting the Dropbox client immediately joins that system into the synchronization group without notifying the authorized user, prompting for credentials, or even getting added to the list of linked devices within your Dropbox account (even though the new system has a completely different name) – this appears to be by design. Additionally, the host_id is still valid even after the user changes their Dropbox password (thus a standard remediation step of changing credentials does not resolve this issue).

Of course, if an attacker has access to the config.db file (assuming that it wasn’t sent by the user as part of social engineering attack), the assumption is that the attacker most likely also has access to all of the files stored in your Dropbox, so what’s the big deal? Well, there are a few significant security implications that come to mind:

Relatively simple targeted malware could be designed with the specific purpose of exfiltrating the Dropbox config.db files to “interested” parties who then could use the host_id to retrieve files, infect files, etc. If the attacker/malware is detected in the system post-compromise, normal remediation steps (malware removal, system re-image, credential rotation, etc) will not prevent continued access to the user’s Dropbox. The user would have to remember to purposefully remove the system from the list of authorized devices on the Dropbox website. This means that access could be maintained without continued access/compromise of a system. Transmitting the host_id/config.db file is most likely much smaller than exfiltrating all data found within a Dropbox folder and thus most likely not set off any detective alarms. Review/theft/etc of the data contained within the Dropbox could be done at the attackers leisure from an external attacker-owned system. So, given that Dropbox appears to utilize only the host_id for authentication by design, what can you do to protect yourself and/or your organization?

Don’t use Dropbox and/or allow your users to use Dropbox. This is the obvious remediating step, but is not always practical – I do think that Dropbox can be useful, if you take steps to protect your data… Protect your data: use strong encryption to protect sensitive data stored in your Dropbox and protect your passphrase (do not store your passphrase in your Dropbox or on the same system/device). Be diligent about removing old systems from your list of authorized systems within Dropbox. Also, monitor the “Last Activity” time listed on the My Computers list within Dropbox. If you see a system checking in that shouldn’t be, unlink it immediately. Hopefully, Dropbox will recognize the need for additional security and add in protection mechanisms that will make it less trivial to gain long-term unauthorized access to a user’s Dropbox as well as provide better means to mitigate and detect an exposure. Until such time, I’m hoping that this writeup helps brings to light how the authentication method used my Dropbox may not be as secure as previously assumed and that, as always, it is important to take steps to protect your data from compromise.


This is no different from password authentication, Kerberos host authentication, or SSH public key authentication, SSL authentication. If an attacker gets access to your secret or private key, your security is compromised until you revoke that credential. There’s nothing Dropbox can to do fix this on the client side, because an attacker can just run a modified version of the software. In order for Dropbox to “fix” this on the server, they’d have to do source address verification, which would break pretty much everyone except people who have static IP addresses. Even then, IP addresses can still be spoofed given a sufficiently sophisticated attacker. The only thing Dropbox could do is to break every device’s authentication whenever a user changes their password. That might be a good idea, or it might just discourage people from changing their passwords.


Well, _my_ ssh and gpg keys are password protected;)

I agree though, there is only so much Dropbox could do. Since you can already deauth a computer, it doesn't need to be done by password resets.

I think if Dropbox detects two host_id's at the same time (not just in the same time, but both after each other in, say, double the sync period) then it should deauth the host and alert the user to what's going on.


It's different in that I don't have any of my passwords or private keys sitting on disk unencrypted.


I wrote an application that verifies that a user's license key is valid. The method I use is that I have a private key on the server that takes the host ID, serial number, username, then digitally signs the data with the private key and sends back the signature.

When the software is reading the key, it verifies the signature (with the same data as sent to the server), then verifies that the host ID in the license file matches the actual host ID from the machine. If anyone attempts to change the host ID to match their computer, then the signature becomes invalid.

Dropbox could generate a signature based on their host-ID + a calculated hardware or OS installation value, then use the signature to validate the host-id in the database plus the calculated value. If the signature is valid, then the machine must be the machine that was originally validated.


Why does it become invalid if a third party sets up the computer like your customers?


I very much doubt dropbox is insecure by design. Skipjack was insecure by design. Dropbox is (arguably) insecure by oversight, or by lack of thoughtful security design.


The problem is that in today world people tend to be alarmist: There is rare case where data is perfectly safe or at least just an app can't make a SYSTEM secure. Notice the upercase: it is the whole system that need to be secure. If the system is compromised, then there is nothing an app can do.


The token in cookie stored by browser is portable, either. How can web apps prevent the attackers exploiting the system from stealing the cookie token?


I guess dropbox could use the systems provided by the OS to securely store passwords like other applications do?


How about revoking the host_id the moment is detected running on two different computers?


Given the name, I would guess the host_id is what they use to identify the computer to avoid having to deal with changing IPs/hostnames/whatever.


That's the point. It should not be possible to have two computers online at the same time with the same host_id.


I just skimmed the article: did the guy do this? It would make sense, or at least be an "easy fix" to disable a host_id if it's seen twice and alert the user to what's going on.


If someone is curious in MacOSX 10.5 and would like to check config.db, it's in a hidden folder in user's profile:

~/.dropbox/


Without physical security there is no security. I don't see how this is a flaw specific to DB.


I'd rather a hacker stole a revocable id/key combo than had access to credentials that were guaranteed full access to my DropBox account.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: