CVE-2026-25537

jsonwebtoken has Type Confusion that leads to potential authorization bypass

Published Feb 4, 2026 CVSS 4.0 · 5.5 Medium EPSS < 1% KEV · Not listed
Description
jsonwebtoken is a JWT lib in rust. Prior to version 10.3.0, 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. This issue has been patched in version 10.3.0.

Analysis

AI-generated

Technical impact

Type confusion in the Rust JWT library allows an attacker to craft a JWT that contains standard claims such as "nbf" or "exp" with an incorrect JSON type, causing the parser to mark the claim as "FailedToParse" and treat it as if the claim were not present. Because the validation logic treats a failed parse identically to a missing claim and because the claim is not marked as required in "required_spec_claims", the library skips validation, permitting the attacker to bypass time‑based restrictions. This flaw can enable authentication or authorization circumvention without the proper credential checks.

Affected Systems

The vulnerability affects all versions of Keats' "jsonwebtoken" Rust library older than 10.3.0. Any application, service, or component that links against this library for JWT validation is potentially exposed, regardless of operating system or deployment environment, as long as the vulnerable version is in use.

Risk and Exploitability

The flaw carries a CVSS score of 5.5 and an EPSS of less than 1%, reflecting moderate severity and a low probability of real‑world exploitation. Attackers can enact the vulnerability by supplying a maliciously crafted JWT to any application endpoint that performs token validation—such as web APIs or authentication middleware—provided they can influence the token payload. The requirement to forge a JWT with the wrong claim type limits the attack to contexts where the attacker has control over token creation or possesses the signing key, thereby bounding risk to systems that issue or process tokens from untrusted sources.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the jsonwebtoken library to version 10.3.0 or later. This patch removes the type‑confusion bug so claim validation behaves correctly.
  • If an immediate upgrade is not possible, add custom validation logic that rejects JWTs where the "nbf" or "exp" claims are not numeric values, ensuring that malformed claims are treated as errors rather than ignored. In applications that already enforce required_spec_claims, extend the enforcement to critical time‑based claims to counter the bug.
  • Consider substituting the vulnerable library with an alternative JWT implementation that enforces strict claim type validation if the current environment cannot be upgraded promptly.

Generated by OpenCVE AI on April 17, 2026 at 23:10 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-h395-gr6q-cpjc jsonwebtoken has Type Confusion that leads to potential authorization bypass
History
Type Values Removed Values Added
CPEs cpe:2.3:a:keats:jsonwebtoken:*:*:*:*:*:rust:*:*
Metrics cvssV3_1

{'score': 5.3, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N'}

cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N'}

Type Values Removed Values Added
References
Metrics threat_severity

None

cvssV3_1

{'score': 5.3, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N'}

threat_severity

Moderate

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Keats
Keats jsonwebtoken
Vendors & Products Keats
Keats jsonwebtoken
Type Values Removed Values Added
Description jsonwebtoken is a JWT lib in rust. Prior to version 10.3.0, 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. This issue has been patched in version 10.3.0.
Title jsonwebtoken has Type Confusion that leads to potential authorization bypass
Weaknesses CWE-843
References
Metrics cvssV4_0

{'score': 5.5, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:P'}

Weaknesses
  • CWE-843

    Access of Resource Using Incompatible Type ('Type Confusion')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Feb 5, 2026, 8:52 PM
Reserved
Feb 2, 2026, 7:59 PM
Status
Analyzed
Published
Feb 4, 2026, 10:15 PM
Modified
Jun 17, 2026, 10:24 AM
Severity
Moderate
Public date
Feb 4, 2026, 9:31 PM