Advisory Database
  • Advisories
  • Dependency Scanning
  1. cargo
  2. ›
  3. jsonwebtoken
  4. ›
  5. CVE-2026-25537

CVE-2026-25537: jsonwebtoken has Type Confusion that leads to potential authorization bypass

February 3, 2026

It has been discovered that there is a Type Confusion vulnerability in jsonwebtoken, specifically, in its claim validation logic.

When a standard claim (such as nbf or exp) is provided with an incorrect JSON type (Like a String instead of a Number), the library’s internal parsing mechanism marks the claim as “FailedToParse”. Crucially, the validation logic treats this “FailedToParse” state identically to “NotPresent”.

This means that if a check is enabled (like: validate_nbf = true), but the claim is not explicitly marked as required in required_spec_claims, the library will skip the validation check entirely for the malformed claim, treating it as if it were not there. This allows attackers to bypass critical time-based security restrictions (like “Not Before” checks) and commit potential authentication and authorization bypasses.

References

  • github.com/Keats/jsonwebtoken
  • github.com/Keats/jsonwebtoken/commit/abbc3076742c4161347bc6b8bf4aa5eb86e1dc01
  • github.com/Keats/jsonwebtoken/security/advisories/GHSA-h395-gr6q-cpjc
  • github.com/advisories/GHSA-h395-gr6q-cpjc
  • nvd.nist.gov/vuln/detail/CVE-2026-25537

Code Behaviors & Features

Detect and mitigate CVE-2026-25537 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 before 10.3.0

Fixed versions

  • 10.3.0

Solution

Upgrade to version 10.3.0 or above.

Impact 5.3 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N

Learn more about CVSS

Weakness

  • CWE-843: Access of Resource Using Incompatible Type ('Type Confusion')

Source file

cargo/jsonwebtoken/CVE-2026-25537.yml

Spotted a mistake? Edit the file on GitLab.

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

Page generated Wed, 04 Feb 2026 00:34:55 +0000.