-
Notifications
You must be signed in to change notification settings - Fork 952
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vulnerability in the JWT token validation #564
Comments
/cc @bshaffer I'd be keen to address this if you have an opinion. |
Hey @phindmarsh! I do not take this lightly, and am sorry for not responding earlier. This is a critical change, and if you are truly willing to submit a PR, I would love to go with whichever option you find more appropriate. Patching the library itself would be easier, as bringing in |
No worries, I'm happy to push a PR for this today. I agree about patching the library rather than pulling in I'll get a PR together applying a fix for the internal JWT class, and we can move the migration to |
Great! Yes, I agree it is ideal to use firebase's jwt library at some
|
JWT::decode() now takes an array of $allowed_algorithms to prevent tricking the server into decoding using a different algorithm than intended. Addresses bshaffer#564
JWT::decode() now takes an array of $allowed_algorithms to prevent tricking the server into decoding using a different algorithm than intended. Addresses bshaffer#564
JWT::decode() now takes an array of $allowed_algorithms to prevent tricking the server into decoding using a different algorithm than intended. Addresses bshaffer#564
JWT::decode() now takes an array of $allowed_algorithms to prevent tricking the server into decoding using a different algorithm than intended. Addresses bshaffer#564
JWT::decode() now takes an array of $allowed_algorithms to prevent tricking the server into decoding using a different algorithm than intended. Addresses #564
JWT::decode() now takes an array of $allowed_algorithms to prevent tricking the server into decoding using a different algorithm than intended. Addresses #564
JWT::decode() now takes an array of $allowed_algorithms to prevent tricking the server into decoding using a different algorithm than intended. Addresses #564
JWT::decode() now takes an array of $allowed_algorithms to prevent tricking the server into decoding using a different algorithm than intended. Addresses bshaffer#564
An alternate patch that maintains backwards compatibility with existing interfaces, but is unsafe for users who call JWT::decode themselves without passing the allowed arguments array.
An alternate patch that maintains backwards compatibility with existing interfaces, but is unsafe for users who call JWT::decode themselves without passing the allowed arguments array.
An alternate patch that maintains backwards compatibility with existing interfaces, but is unsafe for users who call JWT::decode themselves without passing the allowed arguments array.
Recently a 'critical vulnerability' with JWT was disclosed by Auth0.
It essentially boils down to modifying the algorithm header value and tricking a server using rsa signing to use the public key has an hmac secret instead, allowing an attacker who knows the servers public key to craft arbitrary tokens and have auth bypass. See the summary on the Auth0 blog.
The solution to this is to pass the allowed algorithms when decoding a user-specified token, rather than trusting the value in the token header. This is usually fine since the server validating tokens should know what methods have been used to generate them.
The php-jwt lib has applied a patch for this which likely needs to be ported into the embedded JWT class of this library (see commits firebase/php-jwt@10918f2 and firebase/php-jwt@b2c2be6). Alternatively, this lib could depend on firebase/php-jwt directly.
What are your thoughts on either updating the embedded lib, or depending on the php-jwt lib instead? I'm happy to submit a PR either way.
The text was updated successfully, but these errors were encountered: