Insecurity in the Jungle (disk)
daemonology.net
daemonology.net
The impact of using unauthenticated encryption to store data is that your backup provider could end up owning your machine. Attackers can carefully choose which data to corrupt. They can exploit the randomization of corrupted decryption to set up conditions for memory corruption exploits, and, in more sophisticated but totally realistic attacks, exploit guesses about known plaintext to produce attacker-controlled nonrandom plaintexts. A backup provider with client-authenticated crypto can't do that, because the keys that encrypt the data also ensure it's integrity.
The password storage issue is no different than any other password storage problem; again, direct your attention to http://codahale.com/how-to-safely-store-a-password/, mentally substituting "storage of password hash" to "derivation of AES key".
To my mind, the key derivation is the real problem here. A surprisingly large number of secure encryption storage products don't ensure data integrity. Realistic attacks against that vulnerability are feasible but difficult: you'd have to be targeted.
If you're going to write an article about how a competitor's encryption is inferior to yours and cast it as a vulnerability report, I'd suggest not recommending your own encryption scheme as the replacement. The scrypt recommendation in this article sticks out like a sore thumb. Virtually nothing uses scrypt.
We can nerd out on CTR mode vs. CBC mode; I'm starting to come around to Colin's take on CTR because of ciphertext indistinguishability as I see more practical vulnerabilities that take advantage of it. I think the padding issue is a red herring. CBC padding is easier to get right than absolute rock solid reliable generation of CTR nonces and absolute rock solid management of CTR counters, which are things I see people get wrong regularly. Distinguishability is the real problem with CBC.
I think the lack of integrity is more important than you're making it sound. There's a lot of situations where a lack of integrity can be exploited to create a lack of privacy too.
But the main reason I mentioned the lack of integrity first is that I needed to mention the lack of HMAC to explain why they had the ridiculous "salted key hash" construct.
If you're going to write an article about how a competitor's encryption is inferior to yours and cast it as a vulnerability report, I'd suggest not recommending your own encryption scheme as the replacement. The scrypt recommendation in this article sticks out like a sore thumb. Virtually nothing uses scrypt.
I think you're misstating what I wrote a bit. I said that scrypt is the state of the art in the field -- which it is -- and that given that Jungle Disk was around before I developed scrypt, they should have used PBKDF2 or bcrypt.
What privacy attacks were you thinking of? Call some of them out.
Note taken. :-)
What privacy attacks were you thinking of?
Things like replacing files with malware.
I think the author's point about privacy is valid, and a little silly. If I understand correctly (the article is very confusingly worded in some places), he is saying that weak passwords are weak. Anyone who cares about privacy should already be choosing long, complex, strong passwords for this kind of application.
Also, I'm confused about one feature of JD. When I signed up years ago, they allowed me to hold my key privately and it never left the client. I had the option to upload that key to the server, if I wanted to, or not. I understand from the article that the client might misbehave and, for example, share my key in ways I don't want it to. Am I getting this right?
When I looked into secure cloud-based storage two years ago, I found that JD was the best mix of privacy and convenience, if for no other reason than it could be deployed on a mix of Windows, Mac and Linux boxes. It was clear even then that data integrity was the weak link/trade off.
I'm interested in hearing about the latest, best solutions for easy, cross-platform, secure backups to cloud services that offer better data integrity.
First, there's no integrity protection on data stored on Jungledisk. Jungledisk can own up your machine. That's not a good property for a secure backup system to have.
Second, the key derivation scheme it uses makes every passphrase, no matter how carefully chosen, drastically weaker.
I'm glad you like Jungledisk and I don't think you need to read stories like this as an indictment of your choice or a demand to change services. But it doesn't help to downplay them.
I'd just like to repeat this point because it's so important. The password verification method in JungleDisk is fundamentally broken and needs to be rearchitected immediately.
For non-cryptography people, this is similar to the vulnerability that allowed passwords to be retrieved from the Gawker database hack a couple months ago (just not quite as vulnerable).
But, "drastically weaker" than what? If the password is strong, JD doesn't make it weak. JD just doesn't make it as strong as it should/could? Is this correct?
Correct. The vast majority of people can't remember strong passwords, so it's necessary to "strengthen" them using a good key derivation function. Jungle Disk doesn't do this.
I can understand why a responsible developer should assume their users are simple-minded, mouth-breathers who can't be trusted to choose a proper password (and I'm sure there's plenty of evidence to support that assumption), but it just isn't right to characterize JungleDisk as compromised from a security perspective because it relies on the user to choose a strong password.
The Ford Pinto is an unsafe car, and Jungle Disk is an insecure backup service.
I can see why the data integrity issues may allow external factors to compromise the security of my buckets and/or local device. That's me in a Pinto, at the mercy of the bad driver behind me.
I don't see how password strength is open to any external factor; it would seem to be purely a matter of user error. That part doesn't seem to fit the Pinto analogy. That's where I'm struggling to follow your article.
But ultimately what it comes down to is that if 99% of users make a particular error, it isn't useful to say "oh, that's user error".
Why do I care? I just want to understand the risks for someone like me, who has taken care to choose very strong passwords.
My conclusions from all of this:
(1) The data integrity issue is serious because it presents an opportunity for introduction of malicious code, creates a risk of data loss, and may lead to security breaches.
(2) The local binary is opaque, and therefore presents a theoretical risk of compromising even the most "close to the vest" key management strategy.
(3) The password protection issue is a serious shortcoming that can, and should, be mitigated by choosing strong passwords.
Yes?!
It is madness to defend the use of MD5 for password hashing these days. It is clearly not designed for that at all.
Bcrypt, on the other hand, can be tuned to go as slow as you want. You can force it to take 250 milliseconds, regardless of how good or bad the password is.
And that is the fundamental flaw. Jungle Disk's key derivation makes it possible to crack your password in a reasonable time; bcrypt does not. Because of that decision, everybody's data is much less safe as a result (I'm referring to everybody's data in a statistical sense: the average password sucks and is easily broken in this scheme, so the average file is at risk).
As a provider of security software (like my company is doing), Jungle Disk should be doing everything it can to help users keep their data secure. Jungle Disk isn't doing that.
Colin - Perhaps the companies in the backup space that put effort into handling this carefully should work together and create a PSA style website with a matrix chart of how the varies providers handle "encrypted" data. Make it a separate domain and do our best to be elaborately objective about it. Any interest?
I looked on the SpiderOak site, saw a lot of material on how keys are derived and not stored on SpiderOak servers (great!), but didn't see a lot of details about the mechanics of actually encrypting and checking data.
SpiderOak uses AES256 in CFB mode with authentication via HMAC. The code is careful about unique nonce/counter usage, crypto code is confined to specific modules that rarely change, and reviewed by cryptographers outside SpiderOak. Client and server have minimal trust relationship.
Being paranoid about data integrity (not only because of crypto issues, but also because bitrot happens routinely at petabyte scale) the data authentication happens repetitively at a few different layers. From all end user devices, we see about one bit error per 4.2tb of upload transactions.
(Regardless: happy to get together anytime in Chicago).
Not really. I've seen far too many "best practices" and "standards" bodies go nowhere to think that a committee can put together a useful website like this.
The best source for this my scrypt paper, really.
Anyway, the document seems *nix specific. Does Windows have a /dev/random?
(Upon re-reading I think I may have missed the assumption that the long password only contains english text, no punctuation, numerics, etc.)
† For instance, look how it handles message integrity.
As always I think you drastically underestimate how dangerous this stuff is because you've dedicated your career to it, while normal implementors --- even crypto enthusiasts (look at Tor and SSH) --- have little of the nuance required to get it right.
I like the fundamentals of TLS more than you do; I don't think it's a bad or needlessly complex protocol (except maybe session resumption). I see that reasonable people can differ on that point. But, very importantly, TLS is also a vehicle for collecting and implementing the best known methods in cryptography. I think you tend to overlook that.
As always, my opinions are as a software security practitioner and not as a cryptographer, since I am not one.
(As an aside, it's great to see two of my favorite HN commenters in the security field engaged in conversation at this level.)
But, two responses to that:
* First, what Joel Spolsky says about rewrites. Sometimes code is ugly for a reason. Clean rewrites of OpenSSL will inevitably introduce bugs. Introducing bugs in SSL†† implementations is perilous.
* Second, there are mature alternatives to OpenSSL. For instance, most? browsers don't use it.
† In fairness, that's because OpenSSL dates back to a time when nobody was getting C software security even close to right.
†† I use TLS and SSL interchangeably, which is a foible I should work on correcting, but the difference doesn't matter much here.
If TarSnap had iPhone, etc. versions, I would use it for everything. (the permission specific keys are just awesome.)
On my server I use Tarsnap.
On my client I use Wuala's "backup folder" feature.
It is/was used by Chris Wanstrath (of github), among others. http://chris.wanstrath.usesthis.com
I'd also worry, based on that spec, that the Arq developers believe the SHA1 hashes they store are fully equivalent to a deliberate MAC.
I should have noted that Arq's git-like scheme makes them inherently more careful about storage and data integrity (under non-adversarial conditions) than Jungledisk. My perusal of their site was casual. I really don't know much about them and am not offering a professional opinion.
One way or another I want to get this right.
Full-on software reviews, particularly by consultants competent enough to review crypto, are very expensive. You can probably get away without doing one, as long as you get good advice and have people to bounce ideas and problems off of.
Karmically, being someone to bounce ideas and problems off of has paid off for Matasano dramatically, so, anyone else reading this thread, consider this an open invitation.
edit: left out a 'not'
Block-level updates: I don't see a problem with this. Partition the file into blocks on the client (before the encryption). The server doesn't need access to the data for this.
Any scheme that derives passwords from file contents gives me the willies.