The vulnerability lies in the simplejwt library's handling of the PBES2 key management algorithm for JWE decryption. An unauthenticated attacker can craft a JWE with a malicious header containing an extremely large value for the p2c (PBKDF2 iteration count) parameter.
The core of the vulnerability is in the SimpleJWT\Crypt\KeyManagement\PBES2::decryptKey function. In vulnerable versions, this function directly uses the p2c value from the untrusted JWE header without any validation. This value is then passed to the SimpleJWT\Crypt\KeyManagement\PBES2::generateKeyFromPassword function, which in turn uses it in a call to PHP's hash_pbkdf2 function.
The hash_pbkdf2 function's execution time is directly proportional to the iteration count. By providing a very large number, an attacker can force the server to perform a computationally expensive key derivation, consuming significant CPU resources and blocking the process. This leads to a denial of service, as the server becomes unresponsive and legitimate requests cannot be processed.
The patch, identified in commit 70ca5b6f0163f9f5da8e8ae8dce7d9f33b75fb90, addresses this by introducing a checkIterations method that validates the p2c value against a safe minimum and maximum range. This validation is applied in decryptKey before the value is used, effectively neutralizing the DoS vector. The setIterations method was also hardened as a preventative measure.