4 ms·
Amazon Web Services signature version 1 is insecure
- there 18y agoi believe flickr's api uses the same method of creating signatures.
- cperciva 18y agoI just looked at the flickr API documentation, and it looks like you're right -- maybe that's where Amazon got the idea from. I'm not sure if it's a problem in flickr's case, but I'll send them an email pointing out the possible problem.
- cperciva 18y agoThis is interesting: I submitted this article both here and to programming.reddit.com; but at the same time as becoming the top story on news.yc, it got voted down on reddit (well, 1 up vote, 2 down votes). I wonder if this is just the random luck of who happened to see the post on reddit first, or if news.ycers are innately more interested in security-related stories than programming.redditers.
- byrneseyeview 18y agoYou may have a better brand name on news.yc.
- Freaky 18y agoSeems to be doing better on the netsec subreddit. +8, no downvotes in an hour, vs +4-8 in 11 hours on progit
- cperciva 18y agoAha, that explains why I've been seeing traffic from reddit in my logs for the past two hours -- thanks for resubmitting it to the more appropriate subreddit.
- jamess 18y agoDoes it worry anyone else that there seems to be no protection provided against replaying any particular authenticated request? If I were using this service, I'd heavily recommend restricting non-https requests to read-only operations. Any updates or deletes should be done using a security protocol proofed against replay attacks, like HTTPS.
- cperciva 18y agoAt least in the case of SimpleDB, replaying requests is usually not a problem -- if you Put or Delete an attribute which has already been Put or Deleted, it has no effect.
- jamess 18y agoSorry, but you aren't thinking like a security professional here. Consider the case, e.g., where you create a domain, delete it and recreate it. An attacker monitoring the deletion can with impunity wipe out your data at a later date.
- cperciva 18y agoI did say "usually". :-) An attacker monitoring the deletion can with impunity wipe out your data at a later date. Only within the next 15 minutes. Beyond that point, AWS will reject the request for having excess clock skew.
- jamess 18y agoEw! They use the timestamp parameter for that? That's both sick and wrong. Requiring people who access your webservice to have an accurate clock is the most braindead thing I've heard this month, at least. Oh boy, network congestion and clock skew could combine to produce some wonderful heisenbugs for developers. And for what? The want of nonce? Some ridiculous design principle of making your API totally state free. sigh
- 18y ago
- jgrahamc 18y agoThis is a lovely reminder that designing cryptographic protocols is hard. Even something as simple as signing a bit of data can have nasty pitfalls.
- cperciva 18y agoI wouldn't say that this shows that designing cryptographic protocols is hard. "Use hashing and signature methods which don't have collisions" is a simple rule, both to remember and to apply -- no harder than "drive on the right side of the road" (or "drive on the left side of the road", depending on your country). Would you say that driving is hard because people have to remember which side of the road to drive on?
- jgrahamc 18y agoMy assumption is that the Amazon people felt that by using HMAC-SHA1 they were secure because that's a well known way of hashing and signing something. The pitfall was in their implementation. They have such a simple system, yet they managed to make a mistake. This sort of problem is one of the reasons that I made the crypto in tumbler (http://tumbler.sf.net/ http://tumbler.sf.net/) as simple as possible because I was sure that if I did anything but total simplicity I would screw it up.
- tptacek 18y agoAnd because Tumbler is basically a dumbed-down version of the RADIUS protocol, you still wound up with the same major security flaw: if you sniff a Tumbler message off the wire, you can crack it with an incremental SHA256 cracker (which is much faster than Unix crypt). You told people to pick good "passwords"; you should change the language to say "generate good 128 bit random strings".
- tptacek 18y agoIf there were 40 sides of the road to choose from, and the side you drove on depended on the time of day and the color of your car, then yes, Colin, I would say driving on the correct side of the road would be hard too. Have you ever, in your whole career, worked with a team that wrote their own crypto and got it right in version 1? Because I haven't.
- tlrobinson 18y agoPerhaps it's just late and my mind is tired, but it took me a minute to understand what was going on. Maybe a simpler example would be helpful. Since the delimiters are removed before computing the signature (so each is just "ABCDEFGHIJLM"), the signatures for the following two query strings are the same: ?A=B&C=D&E=FHIJKLM ?A=B&C=D&E=F&H=I&J=K&L=M So if the value of of the E parameter is controlled by the user, they can construct a value ("HIJKLM") such that the resulting signatures is the same as the signature for a query with a bunch of additional parameters they choose ("H=I&J=K&L=M"). Clever.
- tptacek 18y agoExample #489643876834 of why you, a very smart, very capable developer, should not be writing crypto code. Rule #1: if you have to type the letters A-E-S or S-H-A into your code, you're doing it wrong.
- brl 18y agoThere are pretty big mistakes to be made on the other side of this philosophy as well. If you need to solve some cryptographic problem which is not exactly the same as something which has already been designed, implemented, and reviewed by competent cryptographers, then you essentially need to create a new protocol and accept all the pitfalls which that entails. PGP seems to be a popular 'primitive' to try to roll your own broken crypto protocol out of. Exhibit A: http://enigform.mozdev.org/ http://enigform.mozdev.org/ Exhibit B: http://web.monkeysphere.info/ http://web.monkeysphere.info/ Even SSL/TLS is not easy to use correctly (while understanding all the risks) for purposes other than what it was originally designed for: Preventing credit card numbers from being sniffed between a browser and a web merchant.
- tptacek 18y agoDesign a transport security protocol that is different in some way from TLS, and a good chunk of those differences are going to be vulnerabilities that the TLS designers figured out that you missed. SSLv1 may have been originally designed for securing credit cards, but I'm not sure that argument survives a close read of TLS; why waste time with mutual authentication, with forward secrecy, with a custom record layer, with arbitrary length certificate signing chains, etc etc etc. You might be surprised at the number of systems that leverage TLS successfully on ports other than 443. We probably agree; no matter how you choose to implement crypto security in a system, you're probably worse off for trying.
- brl 18y agoForward secrecy was one of the important mistakes I had in mind actually. If you use TLS naively, you have none. You probably didn't even realize you needed it. Verifying certificates correctly is not so easy to get right either, if you can even figure out what PKI means for your particular application in the first place.