Jwt Encryption Algorithm Aeskw
Monthly
The web-token/jwt-framework PHP library fails to validate the length of oct keys used with A128KW/A192KW/A256KW, A128GCMKW/A192GCMKW/A256GCMKW and the experimental A128CTR/A192CTR/A256CTR and chacha20-poly1305 key-encryption algorithms, so PHP's OpenSSL extension silently zero-pads short keys (CWE-326/CWE-1284). This is a conditional cryptographic weakness rather than a broadly exploitable flaw: the attacker cannot create the condition, which depends entirely on the application's own key configuration. The worst case is an empty key ({"kty":"oct","k":""}, as produced by JWKFactory::createFromSecret() on an empty string or an unset environment variable), where every content encryption key is wrapped under the all-zero key, letting anyone read issued tokens and forge tokens the application accepts; keys generated at the exact required size (JWKFactory::createOctKey(128), key:generate:oct) are unaffected, and a merely short non-empty key only retains the strength of its own bytes. No public exploit code or CISA KEV entry is associated with this issue at time of analysis; vendor patches are available in 3.4.13, 4.0.9, 4.1.11 and 4.2.6.
The web-token/jwt-framework PHP library fails to validate the length of oct keys used with A128KW/A192KW/A256KW, A128GCMKW/A192GCMKW/A256GCMKW and the experimental A128CTR/A192CTR/A256CTR and chacha20-poly1305 key-encryption algorithms, so PHP's OpenSSL extension silently zero-pads short keys (CWE-326/CWE-1284). This is a conditional cryptographic weakness rather than a broadly exploitable flaw: the attacker cannot create the condition, which depends entirely on the application's own key configuration. The worst case is an empty key ({"kty":"oct","k":""}, as produced by JWKFactory::createFromSecret() on an empty string or an unset environment variable), where every content encryption key is wrapped under the all-zero key, letting anyone read issued tokens and forge tokens the application accepts; keys generated at the exact required size (JWKFactory::createOctKey(128), key:generate:oct) are unaffected, and a merely short non-empty key only retains the strength of its own bytes. No public exploit code or CISA KEV entry is associated with this issue at time of analysis; vendor patches are available in 3.4.13, 4.0.9, 4.1.11 and 4.2.6.