Description
Since "algorithm" isn't enforced in jwt.decode()in jwt-simple 0.3.0 and earlier, a malicious user could choose what algorithm is sent sent to the server. If the server is expecting RSA but is sent HMAC-SHA with RSA's public key, the server will think the public key is actually an HMAC private key. This could be used to forge any data an attacker wants.
Remediation
References
https://nodesecurity.io/advisories/87
https://github.com/hokaccha/node-jwt-simple/pull/16
https://github.com/hokaccha/node-jwt-simple/pull/14
https://auth0.com/blog/2015/03/31/critical-vulnerabilities-in-json-web-token-libraries/
Related Vulnerabilities
CVE-2014-0072 Vulnerability in npm package cordova-plugin-file-transfer
CVE-2020-6452 Vulnerability in npm package electron
CVE-2018-19056 Vulnerability in maven package org.webjars.npm:editor.md
CVE-2016-3506 Vulnerability in maven package com.oracle:ojdbc7
CVE-2021-32828 Vulnerability in maven package org.nuxeo.ecm.platform:nuxeo-platform-oauth