News for hackers. Stuff that matters.
Re:Critical Vulnerabilities in JSON Web Token Libraries by mfjordvald on Wednesday April 01, 2015 @02:19AM (#9301917)
They list the php-jwt library from firebase as vulnerable but I can't see why. As far as I can see they do not support the None algorithm.

https://github.com/firebase/php-jwt/blob/master/Authenticati...

It's not in the methods array and the decode method specifically does a check to see if it's empty.

if (empty($header->alg)) { throw exception }

Can anyone throw some light on this?

Re:Critical Vulnerabilities in JSON Web Token Libraries by ploxiln on Wednesday April 01, 2015 @02:26AM (#9301931)
The second critical problem, which is not addressed by php-jwt, is that it does not take as a parameter to the decode() function which algorithm should be used. It figures out the algorithm by looking at the header.

As the original post describes, if your code expected to use a RSA public/private key pair, then it will pass the public key to decode(). Then an attacker can craft a JWT that claims to use a HMAC symmetric key and sign it with the public key, which is public. One and done.

(your code in that case expected the header to specify an RSA algorithm, and be signed with the private key. but the decode() function doesn't know that)

Re:Critical Vulnerabilities in JSON Web Token Libraries by mfjordvald on Wednesday April 01, 2015 @02:39AM (#9301970)
Cheers, so using this library only to encode should not be an issue for us.
Re:Critical Vulnerabilities in JSON Web Token Libraries by zaroth on Wednesday April 01, 2015 @07:06AM (#9302786)
As in, a third party is doing the decode? You should check which library they are using...