48 points · by cperciva · 17y ago · 52 comments
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.
Would you say that driving is hard because people have to remember which side of the road to drive on?
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.
As far as I know, I got the crypto right in tarsnap. If I didn't, please let me know. :-)
This sort of problem is one of the reasons that I made the crypto in tumbler (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.
You told people to pick good "passwords"; you should change the language to say "generate good 128 bit random strings".
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.
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.
PGP seems to be a popular 'primitive' to try to roll your own broken crypto protocol out of.
Exhibit A: http://enigform.mozdev.org/
Exhibit B: 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.
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.
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.
Even if null data is submitted and someone sniffs the salt, it's still 30-chars long and last I checked rainbow tables don't work too well on SHA-256 hashes of that length.
I ask because I use a system similar to this to just do a basic check to ensure that a form POST is coming from a user clicking an action and not just some random spammers' form just posting the needed vars. It's nothing particularly secure (I think), just a nuisance to any spammer.
Second, the vulnerability here isn't password cracking; it's that AMZN verifies the signature on canonicalized data, but operates on non-canonicalized data.
It's not an issue though because I don't do the key/value pair splitting as they do.
The "dumb" developers just use OpenSSL and PGP, and they usually come out ahead in the end.
Also: I doubt the Amazon implementers here were dumb. I bet they were pretty smart. They just forgot about canonicalization; this is a classic problem in signature systems. Building crypto features is a good way to get screwed.
(PS: I feel qualified to take a contract breaking systems like this, but probably not qualified enough to engineer my own crypto protocol.)