Description
ruby-jwt is a Ruby implementation of the RFC 7519 OAuth JSON Web Token standard. Prior to 2.10.3 and 3.2.0, JWT.decode(token, '', true, algorithm: 'HS256') accepts an attacker-forged token because OpenSSL::HMAC.digest('SHA256', '', payload) returns a valid digest under an empty key and no empty-key precondition exists in the HMAC algorithm. The same path is reached when a keyfinder block or key_finder: argument returns an empty string, nil, or an array containing nil for an unknown key, affecting HS256, HS384, and HS512 verification through JWT.decode and JWT::EncodedToken#verify_signature!. This issue is fixed in versions 2.10.3 and 3.2.0.
Published: 2026-07-14
Score: 9.1 Critical
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerability exists because the Ruby jwt library permits an empty secret key during verification of HS256, HS384, or HS512 tokens. OpenSSL::HMAC.digest('SHA256', '', payload) produces a valid digest even when the key is empty, and the library does not enforce a non‑empty key precondition. Therefore, JWT.decode(token, '', true, algorithm: 'HS256') accepts a forged token signed with an empty key. The same flaw is triggered when a key_finder block or the key_finder: argument returns an empty string, nil, or an array containing nil for an unknown key, which also allows forged tokens to be validated. An attacker can create counterfeit JWTs that are accepted by vulnerable applications, enabling identity spoofing or privilege escalation without knowledge of the real signing key.

Affected Systems

ruby-jwt, the Ruby implementation of JWT, is affected in all releases prior to 2.10.3 and 3.2.0. Any application using the gem’s JWT.decode or JWT::EncodedToken#verify_signature! with HS256, HS384, or HS512 algorithms and supplying an empty string, nil, or a finder block that returns such values is vulnerable.

Risk and Exploitability

The CVSS score of 9.1 classifies this as critical. The EPSS score of less than 1% indicates a low likelihood of exploitation in the general population; nonetheless, the vulnerability is not in the CISA KEV catalog. The likely attack vector is remote: an attacker crafts a token with any payload, signs it with an empty key or lets a key_finder return such a value, and submits it to a vulnerable service that accepts the token for authentication. If the service trusts the token without validating the key, the attacker can gain unauthorized access with minimal effort.

Generated by OpenCVE AI on July 31, 2026 at 04:31 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade the jwt gem to version 2.10.3 or later (for 3.x use 3.2.0)
  • Ensure that all JWT.decode calls provide a non‑empty secret key and that any key finder returns a non‑empty string
  • Audit custom key finder logic to confirm it never yields nil, an empty string, or an array containing nil

Generated by OpenCVE AI on July 31, 2026 at 04:31 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-c32j-vqhx-rx3x ruby-jwt: Empty-key HMAC bypass; cross-language sibling of CVE-2026-44351
History

Mon, 27 Jul 2026 13:15:00 +0000

Type Values Removed Values Added
First Time appeared Jwt
Jwt ruby-jwt
Vendors & Products Jwt
Jwt ruby-jwt

Thu, 16 Jul 2026 12:15:00 +0000

Type Values Removed Values Added
Weaknesses CWE-347
References
Metrics threat_severity

None

threat_severity

Important


Wed, 15 Jul 2026 14:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Tue, 14 Jul 2026 21:45:00 +0000

Type Values Removed Values Added
Description ruby-jwt is a Ruby implementation of the RFC 7519 OAuth JSON Web Token standard. Prior to 2.10.3 and 3.2.0, JWT.decode(token, '', true, algorithm: 'HS256') accepts an attacker-forged token because OpenSSL::HMAC.digest('SHA256', '', payload) returns a valid digest under an empty key and no empty-key precondition exists in the HMAC algorithm. The same path is reached when a keyfinder block or key_finder: argument returns an empty string, nil, or an array containing nil for an unknown key, affecting HS256, HS384, and HS512 verification through JWT.decode and JWT::EncodedToken#verify_signature!. This issue is fixed in versions 2.10.3 and 3.2.0.
Title `jwt` (Ruby gem) - empty-key HMAC bypass
Weaknesses CWE-1391
CWE-287
CWE-326
References
Metrics cvssV3_1

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


cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-07-15T13:26:21.205Z

Reserved: 2026-05-12T00:51:29.085Z

Link: CVE-2026-45363

cve-icon Vulnrichment

Updated: 2026-07-15T13:24:12.925Z

cve-icon NVD

No data.

cve-icon Redhat

Severity : Important

Publid Date: 2026-07-14T21:32:26Z

Links: CVE-2026-45363 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-07-31T04:45:17Z

Weaknesses
  • CWE-1391

    Use of Weak Credentials

  • CWE-287

    Improper Authentication

  • CWE-326

    Inadequate Encryption Strength

  • CWE-347

    Improper Verification of Cryptographic Signature