Skip to main content
← All vulnerabilities
CVE-2022-36083GHSA-JV3G-J58F-9MQ9

JOSE vulnerable to resource exhaustion via specifically crafted JWE

Published
Last modified
published
Not listed in CISA KEV
Fix
Fixed in 1.28.2, 2.0.6, 3.20.4, 4.9.2
None on Exploit-DB, Metasploit or GitHub
  • Exploitation: poc
  • Automatable: yes
  • Technical impact: partial

Summary

JOSE is "JSON Web Almost Everything" - JWA, JWS, JWE, JWT, JWK, JWKS with no dependencies using runtime's native crypto in Node.js, Browser, Cloudflare Workers, Electron, and Deno. The PBKDF2-based JWE key management algorithms expect a JOSE Header Parameter named `p2c` PBES2 Count, which determines how many PBKDF2 iterations must be executed in order to derive a CEK wrapping key. The purpose of this parameter is to intentionally slow down the key derivation function in order to make password brute-force and dictionary attacks more expensive. This makes the PBES2 algorithms unsuitable for situations where the JWE is coming from an untrusted source: an adversary can intentionally pick an extremely high PBES2 Count value, that will initiate a CPU-bound computation that may take an unreasonable amount of time to finish. Under certain conditions, it is possible to have the user's environment consume unreasonable amount of CPU time. The impact is limited only to users utilizing the JWE decryption APIs with symmetric secrets to decrypt JWEs from untrusted parties who do not limit the accepted JWE Key Management Algorithms (`alg` Header Parameter) using the `keyManagementAlgorithms` (or `algorithms` in v1.x) decryption option or through other means. The `v1.28.2`, `v2.0.6`, `v3.20.4`, and `v4.9.2` releases limit the maximum PBKDF2 iteration count to `10000` by default. It is possible to adjust this limit with a newly introduced `maxPBES2Count` decryption option. If users are unable to upgrade their required library version, they have two options depending on whether they expect to receive JWEs using any of the three PBKDF2-based JWE key management algorithms. They can use the `keyManagementAlgorithms` decryption option to disable accepting PBKDF2 altogether, or they can inspect the JOSE Header prior to using the decryption API and limit the PBKDF2 iteration count (`p2c` Header Parameter).

Timeline

  1. CVE published
  2. CISA SSVC assessment

    Exploitation: poc · Automatable: yes · Technical impact: partial

  3. Record last updated

Affected versions

  • panva jose

    From 1.0 · fixed in 1.28.2; From 2.0 · fixed in 2.0.6; From 3.0 · fixed in 3.20.4; From 4.0 · fixed in 4.9.2

  • josenpm

    From 1.0.0 · fixed in 1.28.2

  • jose-browser-runtimenpm

    From 3.0.0 · fixed in 3.20.4

  • jose-node-cjs-runtimenpm

    From 3.0.0 · fixed in 3.20.4

  • jose-node-esm-runtimenpm

    From 3.0.0 · fixed in 3.20.4

  • josenpm

    From 2.0.0 · fixed in 2.0.6

  • josenpm

    From 3.0.0 · fixed in 3.20.4

  • josenpm

    From 4.0.0 · fixed in 4.9.2

  • jose-browser-runtimenpm

    From 4.0.0 · fixed in 4.9.2

  • jose-node-cjs-runtimenpm

    From 4.0.0 · fixed in 4.9.2

  • jose-node-esm-runtimenpm

    From 4.0.0 · fixed in 4.9.2

References 3

GitHub · panva/jose