vendor: https://github.com/cdoco/php-jwt
version: 1.0.0
The jwt_verify_sha_hmac
function of openssl.c
implements the function of comparing the HS256 algorithm signature.
However, the function uses strcmp
to compare the calculated signature with the JWT signature we provided, and strcmp
is not a time-safe comparison function.
This means that the more similar the prefix of the signature we provide to the actual calculated signature, the longer the comparison will take, which can lead to temporal side-channel attacks. An attacker can learn the correct signature and bypass verification.