0.0
NA
CVE-2022-3102
JWT Authentication Bypass via JWS-to-JWE Substitution
Description

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. Quoting 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." This 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. The 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. Several mitigating factors exist that can protect applications from this issue: - 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. - 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. - If the JWK is specified with the 'key_ops' parameter set and it does not include the 'decrypt' operation an exception will be raised. - Applications may check the token type before validation, in this case they would fail to detect an expected JWS Normally, 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. Due 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. Many thanks to Tom Tervoort of Secura for finding and reporting this issue.

INFO

Published Date :

Sept. 21, 2022, 4:58 p.m.

Last Modified :

Jan. 7, 2023, 5:02 a.m.

Remotely Exploit :

No

Source :

github-security-advisories
Affected Products

The following products are affected by CVE-2022-3102 vulnerability. Even if cvefeed.io is aware of the exact versions of the products that are affected, the information is not represented in the table below.

ID Vendor Product Action
1 Latchset jwcrypto
Solution
Secure JWT validation by enforcing proper key usage and token type checks.
  • Ensure private keys are not accessible during validation.
  • Configure JWKs with 'use: sig' for signing keys.
  • Set 'key_ops' to include 'decrypt' for encryption keys.
  • Validate token type before processing signed tokens.
References to Advisories, Solutions, and Tools
CWE - Common Weakness Enumeration

While CVE identifies specific instances of vulnerabilities, CWE categorizes the common flaws or weaknesses that can lead to vulnerabilities. CVE-2022-3102 is associated with the following CWEs:

Common Attack Pattern Enumeration and Classification (CAPEC)

Common Attack Pattern Enumeration and Classification (CAPEC) stores attack patterns, which are descriptions of the common attributes and approaches employed by adversaries to exploit the CVE-2022-3102 weaknesses.

We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).

Results are limited to the first 15 repositories due to potential performance issues.

The following list is the news that have been mention CVE-2022-3102 vulnerability anywhere in the article.

EPSS is a daily estimate of the probability of exploitation activity being observed over the next 30 days. Following chart shows the EPSS score history of the vulnerability.