News for hackers. Stuff that matters.
Re:Ask HN: What's the recommended method of adding authentic... by Blazespinnaker on Tuesday January 16, 2018 @12:42PM (#16160128)
Signed REST requests are good too, more secure. And what’s wrong with delegated auth?
Re:Ask HN: What's the recommended method of adding authentic... by tptacek on Tuesday January 16, 2018 @01:11PM (#16160470)
Signed requests are not in general more secure:

* The implementation of cryptographic "signing" (really, virtually never signing but rather message authentication) is susceptible to implementation errors.

* The concept of signing is susceptible to an entire class of implementation errors falling under the category of "quoting and canonicalization". See: basically every well-known implementation of "signed URLs" for examples.

* Signed URLs have to make their own special arrangements for expiration and replay protection in ways that stateful authentication doesn't, either because the stateful implementation is trivial or because stateful auth "can't" do the things stateful auth can (like explicitly handing off a URL to a third party for delegated execution).

Stateless authentication is almost never a better idea than stateful authentication. In the real world, most important APIs are statefully authenticated. This is true even in a lot of cases where those APIs (inexplicably) use JWTs, as you discover when you get contracted to look at the source code.

Delegated authentication is useful situationally. But really, there aren't all that many situations where it's needed. It's categorically not useful as a default; it's a terrible, dangerous default.

Re:Ask HN: What's the recommended method of adding authentic... by Squithrilve on Wednesday January 17, 2018 @04:59AM (#16166760)
Every time I read a API that uses signed/authenticated requests (AWS, Let's Encrypt ACME) I wonder exactly the same thing - why is this needed in the first place? If TLS guarantees lack of replays it seems to me like signed requests just protect their own complex infrastructure from reusing the same request twice...
Re:Ask HN: What's the recommended method of adding authentic... by Blazespinnaker on Wednesday January 17, 2018 @01:28AM (#16165915)
A lot of text for your argument which is x isn't secure. Not very compelling.

Signed rest requests ensure that auth tokens can not be leaked as each request is individually signed by a private key.

Your extreme example btw is hyperbolic. Providing signing sample code to clients is pretty typical

Re:Ask HN: What's the recommended method of adding authentic... by tptacek on Wednesday January 17, 2018 @11:17AM (#16169089)
I'm explaining where I'm coming from as a courtesy. I am also comfortable with the number and kind of HN readers who would simply take my argument as-stated without justification: "don't do signed URLs if you can get away with bearer tokens".
Re:Ask HN: What's the recommended method of adding authentic... by batoure on Tuesday January 16, 2018 @01:55PM (#16161001)
>susceptible to implementation errors.

So just like anything else you might want to implement if you do it wrong its insecure.

Re:Ask HN: What's the recommended method of adding authentic... by tptacek on Tuesday January 16, 2018 @01:59PM (#16161049)
So really what everyone should do are PAKE schemes based on isogenies, because then we're all post-quantum secure, and, after all, it's only insecure if you do it wrong.
Re:Ask HN: What's the recommended method of adding authentic... by thwiv on Tuesday January 16, 2018 @12:52PM (#16160238)
There's nothing wrong with delegated auth, but in this situation you're not doing any delegation.