Mend.io Vulnerability Database
The largest open source vulnerability database
What is a Vulnerability ID?
New vulnerability? Tell us about it!
CVE-2026-45363
Published:May 18, 2026
Updated:May 19, 2026
"JWT.decode(token, '', true, algorithm: 'HS256')" accepts an attacker-forged token. "OpenSSL::HMAC.digest('SHA256', '', payload)" returns a valid digest under an empty key, and no "raise InvalidKeyError if key.empty?" precondition exists in the HMAC algorithm. JWT.decode(token, "", true, algorithm: 'HS256') -> JWA::Hmac.verify(verification_key: "", ...) -> OpenSSL::HMAC.digest('SHA256', "", signing_input) == signature The same path is reached when a keyfinder block or key_finder: argument returns "", nil, or an array containing nil for an unknown key. JWT::Decode#find_key only rejects literal nil and empty arrays, and JWT::JWA::Hmac silently coerces nil to "" (signing_key ||= '') before signing. JWT.decode(token, nil, true, algorithms: ['HS256']) { |_h| "" } -> find_key returns "" # "" && !Array("").empty? == true -> JWA::Hmac.verify(verification_key: "", ...) -> verifies Common application patterns that produce the unsafe value: "redis.get("kid:#{kid}").to_s", ORM string columns with "default: ''", "ENV['SECRET'] || '', Hash.new('')" lookups, [primary, fallback] where fallback may be nil. Applications passing a non-empty static key:, or whose keyfinder returns nil / raises on miss, are not affected. The existing "enforce_hmac_key_length" option would block this but defaults to false. On OpenSSL ≥ 3.5 the empty-key HMAC.digest call no longer raises, so the OpenSSL-3.0 rescue in JWA::Hmac#sign does not fire. Affects HS256/HS384/HS512 via both JWT.decode (positional key and block keyfinder) and "JWT::EncodedToken#verify_signature!(key_finder:)"
Affected Packages
https://github.com/jwt/ruby-jwt.git (GITHUB):
Affected version(s) >=v1.5.3 <v3.2.0
Fix Suggestion:
Update to version v3.2.0
jwt (RUBY):
Affected version(s) >=0.1.1 <3.2.0
Fix Suggestion:
Update to version 3.2.0
Do you need more information?
Contact Us
CVSS v4
Base Score:
9.1
Attack Vector
NETWORK
Attack Complexity
HIGH
Attack Requirements
NONE
Privileges Required
NONE
User Interaction
NONE
Vulnerable System Confidentiality
HIGH
Vulnerable System Integrity
HIGH
Vulnerable System Availability
NONE
Subsequent System Confidentiality
NONE
Subsequent System Integrity
NONE
Subsequent System Availability
NONE
CVSS v3
Base Score:
7.4
Attack Vector
NETWORK
Attack Complexity
HIGH
Privileges Required
NONE
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
HIGH
Integrity
HIGH
Availability
NONE
Weakness Type (CWE)
Inadequate Encryption Strength
Improper Authentication
Use of Weak Credentials