News for hackers. Stuff that matters.
Re:JSON Web Tokens should be avoided by bgentry on Tuesday March 14, 2017 @01:02PM (#13869289)
Assuming that:

- your JWT libraries don't do anything dumb like accepting the `none` algorithm

- you're using HMAC SHA-256

- your access tokens have a short (~20 min) expiration time

- your refresh tokens are easily revocable

Can you elaborate on the specific security advantages that a token encoded with ActiveSupport::MessageEncryptor would have over such a JWT implementation?

Why do you think there aren't more AS::ME implementations out there if it's a superior solution? I only know of a Go implementation and haven't seen others: https://godoc.org/github.com/mattetti/goRailsYourself/crypto

Edit

I saw you mention Fernet in another comment. As a Heroku alum I'm quite familiar with Fernet (we used it for lots of things), but to my knowledge those projects are on life support at best.

Re:JSON Web Tokens should be avoided by unscaled on Tuesday March 14, 2017 @01:08PM (#13869365)
You should also make sure to allow only tokens with the "HS256" alg headers before you verify them, in case somebody decides to add a new signature algorithm to your library, and it turns out it could easily be broken and lets you use the same key you used for HS256.
Re:JSON Web Tokens should be avoided by tracker1 on Tuesday March 14, 2017 @01:27PM (#13869563)
If it's your software generating the tokens, then that means they'd need the shared key, or private key in order to sign the token... which is already a problem. Now if you're accepting tokens from a third party, that's another issue, and should be much more constrained.

I go farther still and require a VERY short expiration on service to service requests (documented as 1m, coded as 2m) which combined with https limits the chance of replay attacks.

Re:JSON Web Tokens should be avoided by bgentry on Tuesday March 14, 2017 @01:15PM (#13869442)
yes, that's another good point and probably something many folks mess up. I am explicitly specifying my algorithm for both encode/decode :)
Re:JSON Web Tokens should be avoided by cainlevy on Tuesday March 14, 2017 @01:09PM (#13869381)
> using HMAC SHA-256

HMAC is great for monolithic architecture, but I've quite enjoyed using asymmetric RS256. I don't think that's something AS::ME offers.

Re:JSON Web Tokens should be avoided by Zombieball on Tuesday March 14, 2017 @07:37PM (#13872547)
I'd also be interested in hearing an answer to this from tptacek.

My (limited) understanding is the security issues arise around the implementation & handling some of the default claims (NBF, IAT, etc.) and producing/verifying the signature.

But I don't quite understand how moving to a different format solves these issues?