JWTs can be "successfully" encoded and decoded even when algorithm
does not match the EC curve type
#1023
Labels
algorithm
does not match the EC curve type
#1023
You can generate a SECP256K1 keypair and then tell pyjwt to sign a message using algorithm "ES256".
Expected Result
An exception should be raised, because the SECP256K1 curve is not compatible with the ES256 algorithm (it wants ES256K).
Actual Result
An invalid JWT is encoded (signature will not verify against declared algorithm).
Subsequently, the invalid JWT can be decoded "successfully" without error.
This is arguably a security issue, but it only arises if you use the API "wrong". Nonetheless, I think the API should try to guard against such incorrect uses.
Reproduction Steps
System Information
The text was updated successfully, but these errors were encountered: