Forgeable Public/Private Tokens

Affecting jws package, versions <3.0.0

Report new vulnerabilities
Do your applications use this vulnerable package? Test your applications

Overview

jws is an implementation of JSON Web Signatures. Affected versions of this package are vulnerable to an Authentication Bypass attack, due to the "algorithm" not being enforced in jws.verify(). 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 jws to version 3.0.0 or later.

References

CVSS Score

8.7
high severity
  • Attack Vector
    Network
  • Attack Complexity
    High
  • Privileges Required
    None
  • User Interaction
    None
  • Scope
    Changed
  • Confidentiality
    High
  • Integrity
    High
  • Availability
    None
CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:N
Credit
Brian Brennan and Tim McLean
CWE
CWE-310
Snyk ID
npm:jws:20160726
Disclosed
26 Jul, 2016
Published
26 Jul, 2016