OpenIDC cjose uses an all-zero CEK for JWE encryption, exposing plaintext and integrity

Note: This data is for reference and cybersecurity research purposes only.CyStack advises users not to use this information for unlawful purposes.

What is CVE-2026-53939?

CVE-2026-53939 is a vulnerability classified as Use of Hard-coded Cryptographic Key and Use of Insufficiently Random Values, affecting cjose (affected versions: >= 0.6.1, < 0.6.2.6). This vulnerability is rated Critical, with a CVSS score of 9.1. Public exploit code or evidence is available for this vulnerability, but that does not confirm exploitation in the wild.

Overview

Original source data

OpenIDC/cjose is a C library implementing the Javascript Object Signing and Encryption (JOSE). In versions 0.6.1 through 0.6.2.5, when cjose encrypts a JWE using an AES-CBC-HMAC content-encryption algorithm (A128CBC-HS256, A192CBC-HS384, or A256CBC-HS512) together with any key-management algorithm that generates a fresh content-encryption key (CEK), the CEK is all zero bytes instead of being randomly generated. The resulting JWE is therefore encrypted and authenticated under a fixed, publicly known key, so anyone who obtains the JWE can recover the plaintext and forge or modify the content. This is fixed in version 0.6.2.6 by _cjose_jwe_set_cek_aes_cbc() generating the CEK from RAND_bytes. A regression test asserts that the encrypted_key differs across two encryptions for each AES-CBC-HMAC variant. Until upgrading, for data encrypted with cjose, three options are available. Use an AES-GCM enc (A128GCM / A192GCM / A256GCM) instead of an AES-CBC-HMAC enc, use alg=dir with a caller-supplied CEK, or avoid using cjose for JWE encryption with the affected algorithm pair. These are mitigations for new ciphertexts only; data already encrypted under the zero key remains compromised and should be re-encrypted (and any secrets it contained rotated).

Affected products and scope

  • OpenIDC cjose: The normalized record identifies >= 0.6.1, < 0.6.2.6 as affected. The project advisory expresses the same upper boundary as >= 0.6.1, <= 0.6.2.5.
  • The flaw applies when the encryption path uses enc equal to A128CBC-HS256, A192CBC-HS384, or A256CBC-HS512 together with a key-management algorithm that causes cjose to generate the CEK. It does not affect every use of cjose.
  • The advisory describes alg=dir, A128GCM, A192GCM, A256GCM, ECDH-ES, and the decryption path as unaffected by this code path.
  • The confirmed patched release is 0.6.2.6. This record does not establish the status of parallel branches or other downstream packages.

Technical details

OpenIDC cjose is a C library implementing JOSE. The flaw occurs on the JWE encryption path when enc is A128CBC-HS256, A192CBC-HS384, or A256CBC-HS512, and the key-management algorithm asks cjose to generate a fresh CEK. In jwe.c, _cjose_jwe_set_cek_aes_cbc() passes the random flag in the wrong direction when allocating the CEK, causing the buffer to be zero-filled instead of generating the CEK with RAND_bytes. For AES-CBC-HMAC, this fixed value is used for both the AES-CBC encryption key and the HMAC authentication-tag key, so anyone holding the JWE can decrypt it and recompute the authentication tag after modifying the content. The project advisory specifically identifies algorithms such as A128KW, A192KW, A256KW, RSA-OAEP, and RSA1_5, where cjose must generate the CEK; alg=dir, AES-GCM values, ECDH-ES, and the decryption path are described as unaffected. The regression test checks that encrypted_key differs across two encryptions, detecting the fixed-CEK behavior.

Exploitability

The normalized record characterizes exploitation as network-reachable, requiring no authentication or user interaction, with low attack complexity. An attacker needs to obtain a JWE produced by the affected encryption path; the fixed key then allows plaintext recovery and creation of modified content with a valid authentication tag. The record sets public_exploit to true, and the project advisory includes a proof of concept describing the deterministic encrypted_key behavior when the CEK is fixed. The supplied known_exploited and ransomware_campaign fields are null; this does not establish that real-world exploitation is absent.

Technical impact

  • Affected JWEs lose confidentiality because the CEK is fixed and publicly recoverable.
  • They also lose integrity because the same fixed value is used for the HMAC key, allowing an attacker to recompute the authentication tag after changing the content.
  • The technical impact is concentrated in ciphertexts produced by the faulty encryption path; the advisory does not identify decryption as the source of the incorrect CEK.
  • If a ciphertext contains authentication data, tokens, or business-control information, reading or modifying it could affect access decisions and application behavior. The specific consequence depends on the JWE contents and how the receiving application validates and consumes them.
  • The record does not identify a direct availability impact.

Business impact

  • Confidentiality loss: Affected JWEs can be read by anyone who obtains the ciphertext.
  • Integrity loss: JWE contents can be changed and the authentication tag recomputed, so the receiving system may not detect the modification.
  • If a JWE contains tokens, claims, or access-control payloads, forged content could cause incorrect decisions in the consuming application. The exact consequence depends on what the organization places in the JWE.
  • Previously issued ciphertexts are not made safe merely by updating the library. They require re-encryption, and secrets contained in them require rotation.
  • The record does not identify a direct availability consequence.

Remediation

  1. Upgrade: Update cjose to the patched release 0.6.2.6 and redeploy every component that performs JWE encryption.
  2. Mitigate new ciphertexts if an upgrade is not yet possible: Use AES-GCM with enc set to A128GCM, A192GCM, or A256GCM; use alg=dir with a caller-supplied CEK; or avoid using cjose to encrypt JWE with the affected algorithm pair.
  3. Address existing data: Identify JWEs created through the vulnerable encryption path, treat them as exposed and modifiable, then re-encrypt them through a safe path. Rotate every secret contained in those ciphertexts.
  4. Verify the fix: Run a regression test in a controlled environment and confirm that two encryptions produce different encrypted_key values for each AES-CBC-HMAC variant. This result does not make old ciphertexts safe.

Detection

  1. Inventory every deployed build and package that uses cjose, then determine which deployments fall within the affected branch.
  2. Review JWE creation call sites and configuration, especially enc values for AES-CBC-HMAC and alg values that cause cjose to generate the CEK.
  3. In a controlled test, encrypt the same plaintext twice with the same key-management key and compare the encrypted_key field. Identical values are consistent with a fixed CEK, but this check does not replace build verification.
  4. Identify JWE ciphertexts created by the affected encryption path using issuance metadata, application configuration, or application logs. The supplied evidence does not establish a specific production IOC.
  5. For data identified as encrypted through the vulnerable path, inventory any secrets or tokens contained in the ciphertext so they can be re-encrypted and rotated.
Sources (18)
Learn more

Run an in-depth assessment with complete web risk management

CyStack VulnScan continuously discovers assets, validates vulnerabilities, and helps security teams prioritize remediation across the organization.