/

CVE-2026-53939

Severity:

CRITICAL RISK

(9.1)

Predictable Key Generation (CWE-330) in cjose JWE Library

CVE-2026-53939

Awaiting Analysis

Vulnerability type

Category:

Predictable Key Generation

CWE:

CWE-321, CWE-330

Impact:

Confidentiality and Integrity Compromise

Severity:

CRITICAL RISK

(9.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

OpenIDC/cjose versions 0.6.1 through 0.6.2.5 generate an all-zero content-encryption key when encrypting certain AES-CBC-HMAC JWEs with key-management algorithms that create a fresh CEK. Anyone who obtains an affected JWE may be able to decrypt its plaintext and forge or modify authenticated content because the key is fixed and publicly predictable.

Affected context

The issue occurs in cjose JWE encryption when all of the following conditions apply:

  • The AES-CBC-HMAC content-encryption algorithm is used, such as A128CBC-HS256, A192CBC-HS384, or A256CBC-HS512.
  • The selected key-management algorithm generates a new content-encryption key.
  • The affected cjose implementation generates the CEK through the vulnerable AES-CBC handling path.

JWEs produced under these conditions may be decryptable or forgeable by parties that can obtain the ciphertext.

Exploit preconditions

  • Attack surface: Applications or services that use cjose to create JWEs.
  • Required access: Access to an affected JWE; direct access to the encryption process is not necessarily required.
  • Trigger point: JWE encryption using an affected AES-CBC-HMAC algorithm and a key-management mode that creates a fresh CEK.
  • Why exploitation is possible: The generated CEK consists of predictable zero bytes rather than cryptographically random material, allowing the fixed key to be used for decryption or content forgery.

Why this happens

The vulnerable implementation fails to generate a fresh cryptographically secure content-encryption key for applicable AES-CBC-HMAC JWEs. Instead, the CEK is initialized to an all-zero value, violating the requirement that encryption keys be unpredictable and unique.

This maps primarily to CWE-330: Use of Insufficiently Random Values. It is also related to CWE-321: Use of Hard-coded Cryptographic Key, because the effective encryption key is fixed and publicly knowable rather than generated from a secure random source.

Potential impact

  • Attackers may decrypt plaintext contained in affected JWEs.
  • Attackers may forge or modify authenticated JWE content.
  • Confidential information protected by affected ciphertexts could be disclosed.
  • Applications may accept tampered claims, tokens, or configuration data.
  • Secrets contained in previously generated ciphertexts may require rotation.
  • Previously affected data may remain compromised even after the implementation is corrected.

General mitigation guidance

Mitigation focuses on ensuring that every generated CEK comes from a cryptographically secure random source and that vulnerable algorithm combinations are not used.

Common defensive patterns include:

  • Prefer AES-GCM content-encryption algorithms where compatible with deployment requirements.
  • Use a caller-supplied CEK only when the application securely generates, protects, and manages that key.
  • Avoid JWE encryption through affected cjose algorithm combinations until a corrected implementation is available.
  • Re-encrypt data produced with the vulnerable behavior and rotate secrets that may have been exposed.
  • Treat existing ciphertext as potentially compromised rather than assuming that a library correction repairs historical data.
  • Apply least-privilege controls to keys, plaintext, and services responsible for JWE processing.

How teams detect issues like this

Organizations can detect this issue through:

  • Static analysis and dependency review for cjose versions and AES-CBC-HMAC JWE usage.
  • Code review checks for encryption paths that generate fresh CEKs through affected implementations.
  • Regression tests that encrypt equivalent inputs repeatedly and verify that generated encrypted keys and ciphertext components are not deterministically reused.
  • Policy enforcement that restricts approved JWE content-encryption algorithms and rejects vulnerable combinations.
  • Inventory and forensic review of ciphertexts created during the affected deployment period.
  • Automated software composition analysis and security review tools that flag vulnerable dependency ranges and weak key-generation patterns.

Sources

SourceLink
github.comgithub.com/OpenIDC/cjose/commit/2a6e5bd969fa20059fb00913fb9f57d77ea6a4d9
github.comgithub.com/OpenIDC/cjose/releases/tag/v0.6.2.6
github.comgithub.com/OpenIDC/cjose/security/advisories/GHSA-f6wf-pqg3-6wqq

Frequently asked

questions

It can affect an attacker who obtains an affected JWE, even without direct access to the encryption service. The exact exposure depends on whether ciphertexts are publicly accessible or can be obtained through another application weakness.

The attacker generally needs an affected ciphertext. Access to the service that produced the JWE is not inherently required because the CEK is fixed and predictable.

Use a corrected cjose implementation or avoid the affected AES-CBC-HMAC combinations. AES-GCM is a general alternative when supported by the application and interoperability requirements.

Treat data encrypted under the vulnerable behavior as potentially exposed. Re-encrypt it using secure key generation and rotate any credentials, tokens, or secrets that the plaintext may have contained.

Find out what's already
exploitable in your codebase.