web-token jwt-framework and jwt-library before 3.4.13, 4.0.x before 4.0.9, 4.1.x before 4.1.11, and 4.2.x before 4.2.6, and jwt-encryption and jwt-signature through 3.2.10, contain a denial of service vulnerability because the JWS and JWE serializers pass attacker-controlled tokens and protected headers to jsondecode() without bounds before verification. Unauthenticated attackers can submit large tokens with colliding header member names or deeply nested arrays to cause quadratic decoding time or fatal memory exhaustion.
Web-Token jwt-framework and jwt-library before 3.4.13, 4.0.0 before 4.0.9, 4.1.0 before 4.1.11, and 4.2.0 before 4.2.6, and jwt-encryption through 3.2.10, contain a token malleability flaw because JWEDecrypter does not reject a non-empty JWE Encrypted Key with the dir, ECDH-ES and ECDH-SS algorithms, which the authentication tag does not cover. Attackers holding one token can fill the Encrypted Key with arbitrary bytes to derive unlimited distinct token strings that still decrypt, bypassing replay caches, single-use registries or revocation deny-lists keyed on the token string.
web-token jwt-framework and jwt-library before 3.4.13, 4.0.x before 4.0.9, 4.1.x before 4.1.11, and 4.2.x before 4.2.6 (and jwt-encryption through 3.2.10) do not check the key length in JWEBuilder and JWEDecrypter for direct (dir) encryption, so undersized keys are zero-padded. Anyone holding a token issued with a half-size AES-CBC-HMAC key can decrypt it, and an empty key also allows forging tokens the decrypter accepts.