CVE-2021-41106
published medium CVSS 3.1 · 4.4File reference keys leads to incorrect hashes on HMAC algorithms
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| lcobucci | — | jwt>= 3.4.0, < 3.4.6 · >= 4.0.0, < 4.0.4 · >= 4.1.0, < 4.1.5 | Affected | Not stated | GitHub_M |
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 4.4 / 10
- Severity
- medium
- Provider
- GitHub_M · cna
- Vector string
- CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| lcobucci | jwt | >= 3.4.0, < 3.4.6 (affected)>= 4.0.0, < 4.0.4 (affected)>= 4.1.0, < 4.1.5 (affected) | GitHub_M · cna |
Weaknesses
1- CWE-345 CWE-345: Insufficient Verification of Data Authenticity
References
3Provider assertions
2GitHub_M · cna
File reference keys leads to incorrect hashes on HMAC algorithms
CVE · adp
CVE Program Container
Provenance
- Schema
- 5.1
- Searchable
- yes
- Content hash
- 494042810454f34065c13f29299defd1ec9ff53c30a2032bd9417c73e3fa29b4
- Ingested
- 23 Sep 2026, 07:56:07 UTC
- Source record
- Official CVE record