Miggo Logo

CVE-2022-3102: jwcrypto token substitution can lead to authentication bypass

N/A

CVSS Score

Basic Information

EPSS Score
-
CWE
-
Published
9/21/2022
Updated
1/7/2023
KEV Status
No
Technology
TechnologyPython

Technical Details

CVSS Vector
vuln_not_found
Package NameEcosystemVulnerable VersionsFirst Patched Version
jwcryptopip< 1.41.4

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stemmed from JWT processing automatically detecting token type without validation constraints. The key vulnerable functions are: 1) validate() which performed verification/decryption based on auto-detected type rather than enforced expectations, and 2) init() which didn't require specifying expected token type. The commit adds 'expected_type' checks in both initialization and validation paths to prevent type substitution. The pre-patch versions of these functions allowed processing unexpected JWE tokens as valid JWS tokens when decryption keys were available, enabling claim injection.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

T** JWT *o** **n *uto-**t**t t** typ* o* tok*n **in* provi***, *n* t*is **n l*** t** *ppli**tion to in*orr**t *on*lusions **out t** trustwort*in*ss o* t** tok*n. Quotin* t** priv*t* *is*losur* w* r***iv** : "Un**r **rt*in *ir*umst*n**s, it is possi*l

Reasoning

T** vuln*r**ility st*mm** *rom JWT pro**ssin* *utom*ti**lly **t**tin* tok*n typ* wit*out v*li**tion *onstr*ints. T** k*y vuln*r**l* *un*tions *r*: *) v*li**t*() w*i** p*r*orm** v*ri*i**tion/***ryption **s** on *uto-**t**t** typ* r*t**r t**n *n*or***