php-jwt 7 passes the header kid to a ?string parameter, so a token with a
non-string kid throws TypeError before the signature is checked. TypeError
is not an Exception, so validateToken() let it through and the request got a
500. Catch Throwable around JWT::decode() so it is refused like any other
bad token.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
web/vendor still shipped firebase/php-jwt 5.0.0 although composer.json
requires ^7.0 and composer.lock pinned 7.0.0: the lock had been bumped
without regenerating vendor. Run composer update firebase/php-jwt
(7.0.0 -> 7.2.1) and commit the regenerated vendor tree.
php-jwt 6 changed JWT::decode() to take a Key instead of a key and an
array of allowed algorithms, so validateToken() moves to
JWT::decode($token, new Key($key, 'HS256')). Without that every token
would fail to decode. JWT::encode() keeps its signature.
php-jwt 7 also refuses HMAC keys shorter than the hash, which the
preceding ZM_AUTH_HASH_SECRET commits handle, and requires PHP 8.0;
composer's platform_check.php now reports an older PHP at autoload.
Tests: tests/php/test_jwt_vendor.php round trips a token the way
HostController and validateToken() do, refuses a wrong secret, an
expired token and alg none, and fails if any JWT::decode() call uses
the v5 signature, in the web code or these tests.
test_zmu_credentials.php moves to the Key form and a 32 byte secret.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>