News for hackers. Stuff that matters.
Re:Auth0 JWT Auth Bypass: Case-Sensitive Blacklisting Is Har... by CiPHPerCoder on Thursday April 16, 2020 @11:56AM (#22890677)
Tired: {"alg":"none"}

Wired: {"alg":"nonE"}

The JOSE standards (including JWT) are a gift that keeps on giving to attackers.

I designed an alternative format in 2018 called PASETO, which doesn't contain the JOSE foot-guns. (I'm pushing for an IETF RFC this year.)

https://paseto.io

EDIT: Also, this affected their Authentication API rather than their JWT library.

If you use their JWT library, well, it certainly allows this kind of horrendous misuse... but it is not, per se, vulnerable.

Re:Auth0 JWT Auth Bypass: Case-Sensitive Blacklisting Is Har... by speedgoose on Thursday April 16, 2020 @02:05PM (#22891926)
Before starting a new project some time ago, I read about the critics to JOSE (JWE) and the alternative PASETO. I decided to use JOSE carefully instead of PASETO because it had an IETF RFC. I think it will be great for PASETO to get a RFC as well. The second point that made me chose JOSE was that PASETO was a bit too mean towards JOSE, and I didn't want drama in my technology choices.

But good work! With a RFC PASETO will be my choice for my next projects.

Re:Auth0 JWT Auth Bypass: Case-Sensitive Blacklisting Is Har... by Nursie on Thursday April 16, 2020 @02:01PM (#22891892)
We use it, but restrict the sig alg to a couple of known-good values, so am hoping this particular vulnerability is not present in our system.

We had an infosec guy excitedly tell us that PASETO was the future, and we need to change to it right now. It looked good, and a way to avoid some of the possible JiWY issues in the same way having a TLS implementation that only allowed strong ciphers might.

But we have to integrate with so many third party pieces that require JWT it wasn't an option.

Re:Auth0 JWT Auth Bypass: Case-Sensitive Blacklisting Is Har... by different_sort on Thursday April 16, 2020 @01:58PM (#22891868)
Why a new standard than to push for reform to the current standard?

Are they just closely protected by greybeards who won't listen to reason?

Question comes from a true place of ignorance/curiosity, I definitely understand the need to have unambiguous, easy to implement security tokens without the foot-guns.

Re:Auth0 JWT Auth Bypass: Case-Sensitive Blacklisting Is Har... by CiPHPerCoder on Thursday April 16, 2020 @03:11PM (#22892462)
Simple answer: Because secure cryptography is backwards-incompatible with insecure cryptography, and the JOSE standards have a lot of legacy cruft that will be hard to jettison.

If you're going to put in the work (which I am), you might as well start with a clean slate rather than trying to piecemeal security improvements into their design-by-committee spec.

Re:Auth0 JWT Auth Bypass: Case-Sensitive Blacklisting Is Har... by different_sort on Friday April 17, 2020 @08:45AM (#22898492)
Thank you for your reply!
Re:Auth0 JWT Auth Bypass: Case-Sensitive Blacklisting Is Har... by inopinatus on Thursday April 16, 2020 @05:40PM (#22893854)
Speaking as a recidivist greybeard, not sure why you'd think we'd have anything to do with something as callow and unproven as Javascript.
Re:Auth0 JWT Auth Bypass: Case-Sensitive Blacklisting Is Har... by ZenPsycho on Friday April 17, 2020 @01:14AM (#22896409)
JWT has nothing to do with javascript, other than being one of the many many languages that have JWT implementations.
Re:Auth0 JWT Auth Bypass: Case-Sensitive Blacklisting Is Har... by de_watcher on Friday April 17, 2020 @02:17AM (#22896685)
It has a huge vibe of incompetent reinwheeling that is natural to the javascript ecosystem because of the web explosion that gave us a large amount of people with no clue.
Re:Auth0 JWT Auth Bypass: Case-Sensitive Blacklisting Is Har... by ZenPsycho on Friday April 17, 2020 @02:53AM (#22896814)
Just because you have a poisoned view of javascript doesn't mean that everything bad has something to do with javascript. In this case JWT was designed by a C# developer at Microsoft. Maybe you can shift gears to whining about .NET in every thread now?

Oh hey look, he standardised POSIX threads. maybe everything bad is from POSIX?

https://www.microsoft.com/en-us/research/people/mbj/

Re:Auth0 JWT Auth Bypass: Case-Sensitive Blacklisting Is Har... by de_watcher on Friday April 17, 2020 @03:28AM (#22896958)
"You have a poisoned view"? That's just your opinion. I tried to base mine on a somewhat objective observation about speeds and volumes of stuff happening.

"Everything bad has something to do with javascript"? Don't put words in my mouth.

"A C# developer at Microsoft" plus a javascript explosion. Aren't you just confirming my point? Those new people didn't materialise out of thin air, they may have been software developers who had to change focus rapidly. And they didn't necessarily knew how their creations could be misused under the rules of that new javascript world.

And he doesn't look old enough to be a designer of POSIX threads.

(if you don't like my expression about the "vibe" then I'll give you an example of a protocol with a C vibe: the type value would be a fixed-length field with a table of integer IDs written in the standard; everyone would complain about integer sign, wrap-arounds and the new extension field that was added because we ran out of IDs)

Re:Auth0 JWT Auth Bypass: Case-Sensitive Blacklisting Is Har... by ZenPsycho on Friday April 17, 2020 @03:40AM (#22897011)
This is conspiracy theory logic. You could literally use this same line of argument to blame anything bad on a vague "explosion of javascript", fact free. Not very impressive either since it relies on smearing people's competence and professionalism based on handwaving instead of any kind of serious engagement with the facts of the situation. Moving on.
Re:Auth0 JWT Auth Bypass: Case-Sensitive Blacklisting Is Har... by de_watcher on Friday April 17, 2020 @03:55AM (#22897079)
Numbers of developers and code aren't vague. They are disproportionately significant. And you don't even use arguments, just a low-effort labeling.
Re:Auth0 JWT Auth Bypass: Case-Sensitive Blacklisting Is Har... by pillfill on Thursday April 16, 2020 @03:31PM (#22892641)
> Why a new standard than to push for reform to the current standard?

Or even just an opinionated library with some basic guardrails to prevent bad configurations.

Re:Auth0 JWT Auth Bypass: Case-Sensitive Blacklisting Is Har... by kelnos on Thursday April 16, 2020 @03:41PM (#22892722)
That's tempting, but as long as a standard has design flaws, there will be libraries out there that don't prevent bad configurations, and people (through innocent ignorance) will use them and end up in a bad place.
Re:Auth0 JWT Auth Bypass: Case-Sensitive Blacklisting Is Har... by blattimwind on Thursday April 16, 2020 @05:48PM (#22893909)
The whole point of modern cryptography is to take all the oodles of rope to hang yourself with and hand it over to the cryptographers, to leave just the absolute minimum amount of rope with the application developers.

JWT is the opposite of that. It's essentially a reenactment of the bad parts of 90s crypto, including RSA and NONE ciphers.

Re:Auth0 JWT Auth Bypass: Case-Sensitive Blacklisting Is Har... by joepie91_ on Friday April 17, 2020 @06:54AM (#22897902)
I mean, "basic guardrails" is basically exactly what Auth0 tried to do here with their algorithm check, and see how that turned out.
Re:Auth0 JWT Auth Bypass: Case-Sensitive Blacklisting Is Har... by grinich on Thursday April 16, 2020 @12:26PM (#22890992)
I think we're going to use PASETO for some stuff at WorkOS. Thanks for building it. :)
Re:Auth0 JWT Auth Bypass: Case-Sensitive Blacklisting Is Har... by kyrra on Thursday April 16, 2020 @12:23PM (#22890953)
(googler, opinions are my own)

For server-to-server, I continue to prefer PGP to provide my encryption. While Google Payments[0] supports PGP and JWE for encrypting payloads, PGP is well tested and most of the bugs have been worked out. JWS/JWE continues to have implementation bugs (likely due to being too flexible).

[0] https://developers.google.com/standard-payments/reference/be...

Re:Auth0 JWT Auth Bypass: Case-Sensitive Blacklisting Is Har... by CiPHPerCoder on Thursday April 16, 2020 @12:24PM (#22890966)
PGP isn't great either: https://latacora.micro.blog/2019/07/16/the-pgp-problem.html

Better options for PGP use cases:

- AWS Encryption SDK: https://docs.aws.amazon.com/encryption-sdk/latest/developer-...

- age https://age-encryption.org

- Magic Wormhole https://github.com/warner/magic-wormhole

- NaCl/libsodium (and/or usability wrappers) https://libsodium.gitbook.io/doc/

Better options for JWE use cases:

- PASETO: https://paseto.io

- Branca: https://branca.io

Re:Auth0 JWT Auth Bypass: Case-Sensitive Blacklisting Is Har... by stock_toaster on Thursday April 16, 2020 @04:59PM (#22893496)
What are the main differences between Branca and PASETO?

Based on my brief reading of both, it seems like the main differences are:

* Branca has no signing mode, just authenticated encryption (eg. only "local" mode)

* Branca's payload is just arbitrary bytes, whereas PASETO has a defined payload format

* Seems like the same ciphers are used for Branca and PASETO v2/local.

Is that a fair assessment?

Re:Auth0 JWT Auth Bypass: Case-Sensitive Blacklisting Is Har... by CiPHPerCoder on Thursday April 16, 2020 @05:42PM (#22893871)
Yep, that's a fair assessment.

If you want ultra-simplicity and don't need clearsigned tokens (i.e. signed by a third party), you can get away with just using Branca. PASETO covers both use cases.

Re:Auth0 JWT Auth Bypass: Case-Sensitive Blacklisting Is Har... by e12e on Thursday April 16, 2020 @07:46PM (#22894753)
Hm, I think I prefer branca from a quick look (simpler is better). I'm a little worried that both seem to hide away datestamp/validity though.

Branca notes checking the timestamp as optional - I couldn't tell what paseto does by default - other than a reference to a timestamp in the implentor's readme (and then only as an example parameter to the php code).

Paseto does helpfully state that there's no replay protection - so don't use it for stateless (serveless) session tokens.

But to both/either default to some kind of timeout?

I don't really see any use cases where I'd want infinite validity - so in addition to sane algorithms, sane/required exipery seems like it should be part of such things?

I think I might want a serial and a black-list too.. But maybe there are cases where invalidation aren't ever needed? I can't think of one right now.

Re:Auth0 JWT Auth Bypass: Case-Sensitive Blacklisting Is Har... by CiPHPerCoder on Thursday April 16, 2020 @09:07PM (#22895266)
PASETO has the same "claims" as JWT, except they're ISO 8601 timestamps rather than integers (UNIX timestamps).

They're not required (as they weren't in JWT). If you want to use them, use them. The parser will validate them if you want it to.

https://github.com/paragonie/paseto/blob/master/src/Rules/No...

https://github.com/paragonie/paseto/tree/master/docs/02-PHP-...

Re:Auth0 JWT Auth Bypass: Case-Sensitive Blacklisting Is Har... by e12e on Thursday April 16, 2020 @09:37PM (#22895421)
Thanks for the pointers - I'd looked at that, I think, but missed the add-rule bit.

But to be clear, it's easy to set up the validating service so that it accepts a token with expired timestamp as valid - it's the default to not check the timestamp if present?

A token without timestamp will never be valid if a rule for checking timestamp is added in the parser?

Re:Auth0 JWT Auth Bypass: Case-Sensitive Blacklisting Is Har... by CiPHPerCoder on Thursday April 16, 2020 @10:40PM (#22895719)
The default is to not enforce any rules beyond the cryptographic signatures.

If you need any other validations, it's entirely up to you to specify what those are.

You might care about checking `exp`, but I might instead care about `iat` with a hard-coded token lifetime.

PASETO supports whatever zany business logic developers need, but doesn't enforce anything by default.

But once you add a rule to your parser, it will fail-closed on those rules.

> A token without timestamp will never be valid if a rule for checking timestamp is added in the parser?

Correct.

If your parser is set to check timestamps and one is invalid or omitted, it throws an exception.

Re:Auth0 JWT Auth Bypass: Case-Sensitive Blacklisting Is Har... by e12e on Friday April 17, 2020 @05:58AM (#22897621)
OK. I think a brief paragraph along these lines probably should be in (one of) the readme(s).

Personally I think temporal validity really is needed in most cases - and probably should be default. I suppose maybe not for use as long lived api-keys. Then again... infinent validity is almost certainly wrong..

From time to time I wonder how I'd implement kerberos for the web today - probably trading shared secrets for public key/anchoring trust in certificates... And I usually end up realizing it likely will end up just as complex as kerberos5, with similar trade-off/weaknesses (eg ticket hijack).

Maybe paseto has different goals (which is fine) - and maybe it makes sense as a building block - but I think I'd like to see a simple toke spec that demands: valid keys/certs, blacklist/revocation, temporal validity (the simplest is probably a valid from/to on the token). And no crypto algo agility/negotiation etc.

What is the prime motivation behind/use case/goal for paseto?

Re:Auth0 JWT Auth Bypass: Case-Sensitive Blacklisting Is Har... by kyrra on Thursday April 16, 2020 @01:24PM (#22891556)
PGP definitely has it's issues. It is a good tool for dealing with files, but yeah, it has it's problems.

It looks like Google's security team prefers the use of Tink[0] when having to encrypt things.

[0] https://github.com/google/tink

Re:Auth0 JWT Auth Bypass: Case-Sensitive Blacklisting Is Har... by cordite on Thursday April 16, 2020 @01:32PM (#22891637)
Tink is great! I wish there were more supported languages. AEAD and AWS KMS to decrypt the key set is perfect for our needs.
Re:Auth0 JWT Auth Bypass: Case-Sensitive Blacklisting Is Har... by CiPHPerCoder on Thursday April 16, 2020 @01:24PM (#22891564)
Yes, Tink is acceptable too. :)
Re:Auth0 JWT Auth Bypass: Case-Sensitive Blacklisting Is Har... by tptacek on Thursday April 16, 2020 @04:27PM (#22893173)
Tink is fantastic.
Re:Auth0 JWT Auth Bypass: Case-Sensitive Blacklisting Is Har... by kyrra on Wednesday April 22, 2020 @09:28AM (#22945298)
To come back to one other point. Why Google payments uses PGP: because all other payment companies in the world do too. We work with many different companies, and when dealing with files, they all figured out how to use PGP 20+ years ago and probably won't change unless they are forced to. :)

(googler opinions are my own)

Re:Auth0 JWT Auth Bypass: Case-Sensitive Blacklisting Is Har... by XMPPwocky on Thursday April 16, 2020 @04:49PM (#22893392)
> PGP is well tested and most of the bugs have been worked out.

Most of them.

You're either using gnupg or you're using some custom PGP implementation.

A custom PGP implementation has far more footguns than a restricted JWT implementation.

Gnupg is a deeply terrifying codebase- for example, did you know you're not supposed to use the exit code of gpg --verify? You must parse statusfd, too, or many bugs will let you spoof signatures. (Bugs found as recently as this year).

I'd encourage anybody considering using gnupg for anything to read mainproc.c and see if they understand what's going on.

Re:Auth0 JWT Auth Bypass: Case-Sensitive Blacklisting Is Har... by XMPPwocky on Thursday April 16, 2020 @04:50PM (#22893404)
And to be clear, these are not "oh, an adaptive chosen plaintext attack and 2^56 compute may be able to forge signatures" bugs.

These are real, exploitable, and many of the fixes probably won't be backported.

Re:Auth0 JWT Auth Bypass: Case-Sensitive Blacklisting Is Har... by dwaite on Thursday April 16, 2020 @06:26PM (#22894204)
> I'm pushing for an IETF RFC this year.

Are you planning an informational document, or going through the IETF standardization process?

Also, the last published draft is two years old this week. Have there been changes since then to the spec? Are implementations generally interoperable?

Re:Auth0 JWT Auth Bypass: Case-Sensitive Blacklisting Is Har... by CiPHPerCoder on Thursday April 16, 2020 @10:41PM (#22895727)
I'll be sending an email to CFRG, probably next week, with any spec changes.

But before I resuscitate PASETO, XChaCha20 needs an RFC. It's pending IRTF kick-off.

https://tools.ietf.org/html/draft-irtf-cfrg-xchacha-03

Re:Auth0 JWT Auth Bypass: Case-Sensitive Blacklisting Is Har... by OatMilkLatte on Thursday April 16, 2020 @01:19PM (#22891519)
I'm going to use PASETO for a personal project I'm working on. If the COVID lockdown ever ends and I have time to work on it. Thanks for building it!
Re:Auth0 JWT Auth Bypass: Case-Sensitive Blacklisting Is Har... by bflesch on Thursday April 16, 2020 @12:11PM (#22890830)
Paseto is a great project, thank you very much for your contribution!
Re:Auth0 JWT Auth Bypass: Case-Sensitive Blacklisting Is Har... by ucarion on Thursday April 16, 2020 @12:22PM (#22890947)
What IETF WG are you working through?
Re:Auth0 JWT Auth Bypass: Case-Sensitive Blacklisting Is Har... by CiPHPerCoder on Thursday April 16, 2020 @12:23PM (#22890952)
CFRG
Re:Auth0 JWT Auth Bypass: Case-Sensitive Blacklisting Is Har... by tptacek on Thursday April 16, 2020 @01:40PM (#22891715)
Are there links to more recent discussions on CFRG? Did you take any of the critiques from CFRG to heart? I think the v1/v2 local/public points were well-taken.
Re:Auth0 JWT Auth Bypass: Case-Sensitive Blacklisting Is Har... by CiPHPerCoder on Thursday April 16, 2020 @01:45PM (#22891762)
Nothing from 2020 yet. XChaCha has to be prioritized first.
Re:Auth0 JWT Auth Bypass: Case-Sensitive Blacklisting Is Har... by ucarion on Thursday April 16, 2020 @12:46PM (#22891198)
Good luck! Seems like previous discussions with the mailing list could have gone better, but PASETO seems like promising work!