Firebase PHP-JWT key/algorithm type confusion
Impact
In Firebase PHP-JWT before 6.0.0, an algorithm-confusion issue (e.g., RS256 / HS256) exists via the kid (aka Key ID) header, when multiple types of keys are loaded in a key ring. This allows an attacker to forge tokens that validate under the incorrect key. NOTE: this provides a straightforward way to use the PHP-JWT library unsafely, but might not be considered a vulnerability in the library itself.
Source excerpt · OSVAffected packages
Start with the recorded fix for your release branch. Check your installed version and test compatibility before upgrading. Fixing this advisory does not rule out other vulnerabilities in the release.
| Affected range | Recorded fix |
|---|---|
| Earlier releases before 6.0.0Ecosystem versions | 6.0.0 |
Version evidence: OSV · GHSA-8xf4-w7qw-pjjw
View original version evidence (14 explicit versions)
Original source description
In Firebase PHP-JWT before 6.0.0, an algorithm-confusion issue (e.g., RS256 / HS256) exists via the kid (aka Key ID) header, when multiple types of keys are loaded in a key ring. This allows an attacker to forge tokens that validate under the incorrect key. NOTE: this provides a straightforward way to use the PHP-JWT library unsafely, but might not be considered a vulnerability in the library itself.
References
- Security advisory nvd.nist.gov/vuln/detail/CVE-2021-46743
- Source reference github.com/firebase/php-jwt/issues/351
- Security advisory github.com/FriendsOfPHP/security-advisories/blob/master/firebase/php-jwt/CVE-2021-46743.yaml
- Source reference github.com/firebase/php-jwt
- Release notes github.com/firebase/php-jwt/releases/tag/v6.0.0