Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. jwt-simple
  4. ›
  5. GMS-2016-79

GMS-2016-79: Forgeable Public/Private Tokens

October 31, 2016

Since algorithm isn’t enforced in jwt.decode(), 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.

References

  • auth0.com/blog/2015/03/31/critical-vulnerabilities-in-json-web-token-libraries/
  • github.com/hokaccha/node-jwt-simple/pull/14
  • github.com/hokaccha/node-jwt-simple/pull/16

Code Behaviors & Features

Detect and mitigate GMS-2016-79 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions

Solution

Change jwt.decode() to include an algorithm parameter.

Source file

npm/jwt-simple/GMS-2016-79.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:14:48 +0000.