CVE-2021-41106: JWT - Broken Authentication
- Cve: CVE-2021-41106
- Name: JWT - Broken Authentication
- 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.
- Impact: Attackers can issue or validate tokens with incorrect keys, potentially leading to token forgery or bypassing authentication.
- Remediation: Update to version 3.4.6, 4.0.4, or 4.1.5 or later, or use InMemory keys as recommended.
- Vulnerability type: jwt_misconfiguration
- Vulnerability impact: data_tampering
- Requirement type: none
- Labels source: projectdiscovery
- Severity: low
- Cvss score: 3.3
- Cvss vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N
- Epss score: 0.00205
- Epss percentile: 0.10349
- Assignee: [email protected]
- Published at: 2021-09-28T21:15:07Z
- Age in days: 1883
- Modified at: 2026-06-17T04:07:53Z
- Patch available: yes
- References total: 3
- Products total: 1
- Oss: yes
- Projects total: 1
- Advisory url: https://nvd.nist.gov/vuln/detail/CVE-2021-41106
- Nvd status: modified
- Checked, none or zero: known exploited entries, nuclei templates, public exploits total, public exploits capped, public exploits, rejected by nvd
- Not known: requirements, hackerone
Cwe
| Id | Name |
|---|---|
| CWE-345 | Insufficient Verification of Data Authenticity |
References
Same in every row:
- Source: nvd
- Tags: Patch, Third Party Advisory
Products
| Product | Affected | Platform bound | Sources | Url |
|---|---|---|---|---|
| lcobucci:jwt | >= 4.1.0, < 4.1.5; >= 4.0.0, < 4.0.4; >= 3.4.0, < 3.4.6 | no | nvd | /v1/products/lcobucci/jwt |
Projects
| Repository | Link kinds | Indexed | Url |
|---|---|---|---|
| lcobucci/jwt | commit, package, security_advisory | yes | /v1/repositories/lcobucci/jwt |
Index
- Repositories: 2
- Repositories high signal: 1
- Packages: 1
Exploitation
- Authentication required: yes
- Checked, none or zero: known exploited, known exploited by, exploitation seen, public exploit, public exploit count, initial access, remote
- Not known: known exploited since, vulncheck known exploited since, public exploit first date, nuclei template, initial access since, hackerone reports, exposed hosts