CVE-2022-23541: medium-severity vulnerability in auth0 node-jsonwebtoken
jsonwebtoken's insecure implementation of key retrieval function could lead to Forgeable Public/Private Tokens from RSA to HMAC
Published · Updated
E-mail alert when it lands in KEV, gets a public PoC or its score goes up.
No sign of exploitation. No public exploitation artifact known so far.
The jsonwebtoken library (versions ≤ 8.5.1) can incorrectly verify JSON Web Tokens if the key retrieval function is poorly implemented, allowing attackers to forge valid tokens by switching from asymmetric (RSA) to symmetric (HMAC) algorithms. This happens because the library may accept tokens signed with one algorithm but verified with a different one.
The vulnerability exists in the key retrieval mechanism of jsonwebtoken ≤ 8.5.1, where misconfiguration allows algorithm confusion attacks. An attacker can forge tokens by exploiting weak key retrieval functions that fail to enforce algorithm consistency between signing and verification, enabling RSA-signed tokens to be validated using HMAC with a symmetric key. Pre-condition: application must use both symmetric and asymmetric keys in the same jwt.verify() function.
In the same product, most dangerous first.