Executive brief
Cisco node-jose is a JavaScript library used to sign and encrypt JSON Web Tokens (JWTs), which are commonly used for authentication in web applications. A vulnerability allows an attacker to forge valid authentication tokens by removing the original signature and embedding their own public key in the token header, bypassing authentication controls. An attacker could exploit this to gain unauthorized access to systems relying on this library for token validation.
Technical details
The vulnerability is an improper validation of JWT signatures (CWE-347) in the Cisco node-jose library before version 0.11.0. The root cause is that the library follows the JWS standard which permits embedding a JSON Web Key (JWK) public key in the token header; node-jose improperly trusts this embedded key for verification without additional validation. An unauthenticated remote attacker can exploit this by crafting a malicious JWS object: remove the original signature, inject an attacker-controlled public key in the header, and re-sign using the corresponding private key. The attack requires network access to a system using the vulnerable library for JWT validation, but no authentication or user interaction. This allows complete forgery of authentication tokens. The vulnerability was fixed in version 0.11.0.
Affected products
- Cisco node-jose before 0.11.0
Timeline
- 2018-01-04: disclosed
- 0.11.0: patched
- 2022-05-13: advisory