CVE-2021-41106Lcobucci Jwt
Low 3.3
Follow: this CVE · Lcobucci · Lcobucci Jwt We alert you by email or Slack (account required).
- Priority
- 20
- CVSS 3.1
- 3.3
- EPSS
- 0.2% probability of exploitation in 30 days · percentile 6
- Auth required
- Yes
- Published
- Sep 28, 2021
- Updated
- Jun 17, 2026
- Category
- Application · Cross-platform
- Weakness (CWE)
- CWE-345
- Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N
What happens
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.
What to do
- Apply the vendor's security update for Jwt.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | How to upgrade |
|---|---|---|---|---|
| Packagist | lcobucci/jwt |
≥ 3.4.0 < 3.4.6 |
3.4.6 |
composer require "lcobucci/jwt:^3.4.6" |
| Packagist | lcobucci/jwt |
≥ 4.0.0 < 4.0.4 |
4.0.4 |
composer require "lcobucci/jwt:^4.0.4" |
| Packagist | lcobucci/jwt |
≥ 4.1.0 < 4.1.5 |
4.1.5 |
composer require "lcobucci/jwt:^4.1.5" |
Per OSV / GitHub Advisories (GHSA-7322-jrq4-x5hf). Check the version in your lockfile before upgrading.
Affected products (CPE)
| Vendor | Product | Versions |
|---|---|---|
| lcobucci | jwt | ≥ 3.4.0 < 3.4.6 |
| lcobucci | jwt | ≥ 4.0.0 < 4.0.4 |
| lcobucci | jwt | ≥ 4.1.0 < 4.1.5 |
Official sources
References
Links published by the sources. Open them with care.
- github.com Patch Third Party Advisory
- github.com Patch Third Party Advisory
- github.com Patch Third Party Advisory