Authentication Bypass

Affecting jsonwebtoken package, versions <4.2.2

Do your applications use this vulnerable package? Test your applications

Overview

jsonwebtoken is a JSON Web token implementation for symmetric and asymmetric keys. Affected versions of this package are vulnerable to an Authentication Bypass attack, due to the "algorithm" not being enforced. Attackers are given the opportunity to choose the algorithm sent to the server and generate signatures with arbitrary contents. The server expects an asymmetric key (RSA) but is sent a symmetric key (HMAC-SHA) with RSA's public key, so instead of going through a key validation process, the server will think the public key is actually an HMAC private key.

Remediation

Upgrade jsonwebtoken to version 4.2.2 or greater.

References

Snyk patch available for versions:

CVSS Score

7.5
high severity
  • Attack Vector
    Network
  • Attack Complexity
    Low
  • Privileges Required
    None
  • User Interaction
    None
  • Scope
    Unchanged
  • Confidentiality
    High
  • Integrity
    None
  • Availability
    None
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Credit
Tim McLean
CVE
CVE-2015-9235
CWE
CWE-592
Snyk ID
npm:jsonwebtoken:20150331
Disclosed
31 Mar, 2015
Published
31 Mar, 2015