You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Applies to <= 2.1.0, fixed in >= 2.2.0] While it is possible to use symbolized claim names everywhere, the exp claim is only validated if passed as string key to encode.
While it is possible to use string keys everywhere, algorithm/algorithms is requred to be a symbol, while being in the same options hash where string keys work perfectly fine.
> token=JWT.encode({'aud'=>'foo'},'key')=>"eyJhbGciOiJIUzI1NiJ9.e30.FOOB1UqKAhjxqs3lV7BidJ12zFAsIGq1erQfNyaFf80"
> JWT.decode(token,'key',true,'aud'=>'foo','verify_aud'=>true,'algorithm'=>'HS384')=>[{"aud"=>"foo"},{"alg"=>"HS256"}]# not the allowed algorithm!
Gladly, none is not an allowed algorithm in the payload by default, but if this logic is changed in a wrongfull manner (see #323 as a possible cause of such changes, for example) it is going to create a security whole immediately regarding misued string 'algorithm' key.
Anyway, even without the known "alg none" issue, a possibility to unknowingly break algorith validation is concerning.
The text was updated successfully, but these errors were encountered:
exp
claim is only validated if passed as string key toencode
.Which may lead to unexpected results:
algorithm
/algorithms
is requred to be a symbol, while being in the same options hash where string keys work perfectly fine.Gladly,
none
is not an allowed algorithm in the payload by default, but if this logic is changed in a wrongfull manner (see #323 as a possible cause of such changes, for example) it is going to create a security whole immediately regarding misued string'algorithm'
key.Anyway, even without the known "alg
none
" issue, a possibility to unknowingly break algorith validation is concerning.The text was updated successfully, but these errors were encountered: