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
If a JWK has an exponent different from 65537 or 3, the parsing fails with the following error:
"Jwks RSA [n] or [e] field is missing or has a parse error"
For example, parsing will fail for the following valid JWK:
In theory, e can be any non-negative number that is coprime to the Euler totient of n. In practice, the exponent should always be 65537, and even 3 should be discouraged, given Coppersmith attacks, and I don't think allowing different exponents is a good idea.
I agree that 65537 is the best practice. But this library is used for JWT validation, and I think it should accept all the valid exponent values (even if they are not the best practice/not secured enough).
In my case, the Idp service (external provider) uses different values for the exponent, which prevents us from using istio authentication. As the exponent is not 65537 or 3, we get the following error:
Jwks RSA [n] or [e] field is missing or has a parse error.
Supporting arbitrary values of e is also a DoS risk. BoringSSL won't accept any e over 33 bits for this reason. We're stuck being a bit more permissive than just 3 and 65537, but the constraints in this library are sound. I don't think it makes sense to change it.
Were RSA standardized correctly, we'd have just picked the one value of e as part of a parameter set and moved on with life.
As raised in istio/istio#41729
If a JWK has an exponent different from 65537 or 3, the parsing fails with the following error:
"Jwks RSA [n] or [e] field is missing or has a parse error"
For example, parsing will fail for the following valid JWK:
I couldn't find any reference that the exponent must be 65537 or 3, even though 65537 is commonly used.
opened PR #95, which should fix the JWK validation. I'd appreciate if you could review it.
The text was updated successfully, but these errors were encountered: