icon

We found results for “

CVE-2022-3102

Good to know:

icon
icon

Date: August 19, 2025

The JWT code can auto-detect the type of token being provided, and this can lead the application to incorrect conclusions about the trustworthiness of the token.\nQuoting the private disclosure we received : \"Under certain circumstances, it is possible to substitute a [..] signed JWS with a JWE that is encrypted with the public key that is normally used for signature validation.\"\nThis substitution attack can occur only if the validating application also have access to the private key, normally used to sign the tokens, available during validation of the received JWT.\nThe significance of this attacks depends on the use of the token, it may lead to authentication bypass or authorization bypass (respectively if claims are used to authenticate or authorize certain actions), because the attacker has full control of the data placed in the JWE and can inject any desired claim value.\n\nSeveral mitigating factors exist that can protect applications from this issue:\n- If the private key corresponding to the public key used to encrypt the JWE is not available to the application an exception will be raised.\n- If the JWK is specified with the 'use' parameter set to 'sig' (as expected for keys used only for signing/verification) an exception will be raised.\n- If the JWK is specified with the 'key_ops' parameter set and it does not include the 'decrypt' operation an exception will be raised.\n- Applications may check the token type before validation, in this case they would fail to detect an expected JWS\n\nNormally, signing and validation are done by different applications, so this scenario should be unlikely. However it is possible to have applications that both sign and validate tokens and do not separate JWKs in use, or do not set a JWK 'use' type.\n\nDue to the mitigating factors, and the fact that specific operational constraints and conditions need to be in place to successfully exploit this issue to generate an authentication bypass, we rate this security issue as moderate. Other avenues may decide on a different rating based on use case, always verify what conditions apply to your use of the library to assess risk.\n\nMany thanks to Tom Tervoort of Secura for finding and reporting this issue.

Language: Python

Severity Score

Severity Score

Top Fix

icon

Upgrade Version

Upgrade to version jwcrypto - 1.4

Learn More

CVSS v3.1

Base Score:
Attack Vector (AV): NETWORK
Attack Complexity (AC): LOW
Privileges Required (PR): NONE
User Interaction (UI): NONE
Scope (S): UNCHANGED
Confidentiality (C): HIGH
Integrity (I): HIGH
Availability (A): HIGH

Do you need more information?

Contact Us