CVE-2021-46743:
Firebase PHP-JWT key/algorithm type confusion
9.1
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.76202%
CWE
Published
3/30/2022
Updated
2/21/2023
KEV Status
No
Technology
PHP
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
firebase/php-jwt | composer | < 6.0.0 | 6.0.0 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from how pre-6.0.0 versions handled key selection. When multiple keys were provided (e.g., as an array/keyring), the 'kid' header dictated key selection, but there was no enforcement that the selected key matched the token's 'alg' header. This allowed algorithm confusion attacks. The decode
function (JWT::decode
) was modified in v6.0.0 to require a Key object binding keys to algorithms, confirming this was the focal point. The GitHub issue #351 and release notes explicitly reference this function's role in the vulnerability.