CVE-2021-41106

File reference keys leads to incorrect hashes on HMAC algorithms

LOW
3.3
CVSS Score
Published: September 28, 2021 at 08:50 PM UTC
Updated: June 17, 2026 at 04:07 AM UTC
1 product affected across 1 vendorProject Jwt

Using jwt by lcobucci?

Get instant alerts when new vulnerabilities affect jwt - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
LOW3.3
Exploit prediction
EPSS 0.2%

Description

JWT is a library to work with JSON Web Token and JSON Web Signature. Prior to versions 3.4.6, 4.0.4, and 4.1.5, users of HMAC-based algorithms (HS256, HS384, and HS512) combined with `Lcobucci\JWT\Signer\Key\LocalFileReference` as key are having their tokens issued/validated using the file path as hashing key - instead of the contents. The HMAC hashing functions take any string as input and, since users can issue and validate tokens, users are lead to believe that everything works properly. Versions 3.4.6, 4.0.4, and 4.1.5 have been patched to always load the file contents, deprecated the `Lcobucci\JWT\Signer\Key\LocalFileReference`, and suggest `Lcobucci\JWT\Signer\Key\InMemory` as the alternative. As a workaround, use `Lcobucci\JWT\Signer\Key\InMemory` instead of `Lcobucci\JWT\Signer\Key\LocalFileReference` to create the instances of one's keys.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v < 3.4.6v < 4.0.4v < 4.1.53.4.0 ≤ v < 3.4.64.0.0 ≤ v < 4.0.44.1.0 ≤ v < 4.1.5
Affected range stops below 3.4.6, so it looks safe — our inference, not a vendor statement
Affected range stops below 4.0.4, so it looks safe — our inference, not a vendor statement
Affected range stops below 4.1.5, so it looks safe — our inference, not a vendor statement

CVSS

Attack Vector
LOCAL
Complexity
LOW
Privileges
LOW
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
NONE
Integrity
LOW
Availability
NONE
Vector?

Quick Info

StatusMODIFIED
CWE
CWE-345

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card