Skip to main content
EPSS 0.2%top 86%

CVE-2026-53938: CWE-122: Heap-based Buffer Overflow in OpenIDC cjose

0
Critical
Published: 09/25/2026 (09/25/2026, 01:27:46 UTC)
Source: CVE Database V5
Vendor/Project: OpenIDC
Product: cjose

Description

Implementation of JOSE for C/C++ Security Fix(es): OpenIDC/cjose is a C library implementing the Javascript Object Signing and Encryption (JOSE). Prior to version 0.6.2.5, cjose's JWE decryption path for the AES Key Wrap key-management algorithms (`alg` = `A128KW`, `A192KW`, `A256KW`) does not validate the length of the attacker-supplied `encrypted_key` (JWE Encrypted Key) before unwrapping it into a fixed-size, heap-allocated Content Encryption Key (CEK) buffer. A remote, unauthenticated attacker who can submit a crafted JWE to an application that decrypts it with an AES-KW symmetric key can trigger an out-of-bounds heap write, corrupting the heap. This leads at minimum to a crash (denial of service) and, depending on the heap layout and allocator, may be leverageable for further memory-corruption impact. `cjose_jwe_import()` / `cjose_jwe_decrypt()` are pre-authentication entry points: they parse and process fully attacker-controlled input. Upgrade to cjose 0.6.2.5 to receive a patch. If upgrading is not immediately possible, reject the AES Key Wrap algorithms (`A128KW`/`A192KW`/`A256KW`) for untrusted JWEs at the application layer.(CVE-2026-53938) 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).(CVE-2026-53939)

CVSS v3.1

Score 8.2high

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
Low
Availability
High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H

Affected software

OpenIDC

cjose

Affected versions
<0.6.2.5
GitHub Actionsmore threats →ai
openidc/cjose
pkg:github/openidc/cjose
Affected versions
<0.6.2.5

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 09/25/2026, 04:46:08 UTC

Technical Analysis

OpenIDC/cjose is a C library implementing JOSE. Prior to version 0.6.2.5, the JWE decryption path for AES Key Wrap algorithms (`A128KW`, `A192KW`, `A256KW`) does not validate the length of the attacker-supplied `encrypted_key` before unwrapping it into a fixed-size heap buffer, leading to a heap-based buffer overflow (CWE-122). This can cause heap corruption and denial of service, with potential for further memory corruption depending on heap layout. The vulnerable functions are `cjose_jwe_import()` and `cjose_jwe_decrypt()`, which process attacker-controlled input without authentication. Separately, versions 0.6.1 through 0.6.2.5 have a vulnerability in JWE encryption using AES-CBC-HMAC content encryption algorithms (`A128CBC-HS256`, `A192CBC-HS384`, `A256CBC-HS512`) combined with key-management algorithms that generate fresh CEKs: the CEK is set to all zero bytes instead of being randomly generated. This results in ciphertexts encrypted under a fixed, publicly known key, allowing plaintext recovery and forgery. This second issue is fixed in version 0.6.2.6 by generating the CEK from a cryptographically secure random source. Mitigations include upgrading to 0.6.2.5 for the first issue and 0.6.2.6 for the second, rejecting AES Key Wrap algorithms for untrusted JWEs if upgrade is not possible, or using alternative encryption algorithms such as AES-GCM or `alg=dir` with caller-supplied CEK.

Potential Impact

The heap-based buffer overflow can be triggered remotely by unauthenticated attackers submitting crafted JWEs, leading to heap corruption and denial of service. Depending on heap allocator and layout, it may be exploitable for further memory corruption. The encryption flaw causes JWEs encrypted with AES-CBC-HMAC algorithms to use a fixed all-zero CEK, allowing attackers to decrypt and forge ciphertexts, compromising confidentiality and integrity of encrypted data. Data encrypted with the affected versions and algorithms is compromised and should be re-encrypted with secure keys.

Mitigation Recommendations

Upgrade to cjose version 0.6.2.5 or later to fix the heap-based buffer overflow vulnerability. For the encryption key issue, upgrade to version 0.6.2.6 or later. If immediate upgrade is not possible, reject AES Key Wrap algorithms (`A128KW`, `A192KW`, `A256KW`) for untrusted JWEs at the application layer to mitigate the buffer overflow risk. For new ciphertexts, avoid AES-CBC-HMAC content encryption algorithms or use AES-GCM variants (`A128GCM`, `A192GCM`, `A256GCM`), or use `alg=dir` with a caller-supplied CEK. Data already encrypted with the zero-key CEK should be re-encrypted and any secrets rotated. No other mitigations are indicated by the vendor advisory.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2026-06-11T15:46:12.318Z
Cvss Version
3.1
State
PUBLISHED

Threat ID: 6aa09c46acd9273b49610551

Added to database: 09/08/2026, 23:37:42 UTC

Last enriched: 09/25/2026, 04:46:08 UTC

Last updated: 10/23/2026, 15:12:05 UTC

Views: 109

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses