REDHAT-BUG-2530240: High severity openidc cjose vulnerability
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 encryptedkey (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. cjosejweimport() / cjosejwedecrypt() 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.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
OpenIDC/cjoseto a version that resolves this vulnerability.Fixed in 0.6.2.5 - Configuration
At the application layer, reject the AES Key Wrap algorithms A128KW, A192KW, and A256KW for untrusted JWEs if upgrading is not immediately possible.
Application JWE handling Accepted AES Key Wrap algorithms = Reject A128KW, A192KW, and A256KW for untrusted JWEs
Event History
Frequently Asked Questions
Which deployments are exposed?
Applications are exposed if they use cjose to decrypt untrusted JWEs with an AES Key Wrap symmetric key and permit A128KW, A192KW, or A256KW. The affected processing occurs through the pre-authentication cjose_jwe_import() and cjose_jwe_decrypt() entry points.
Does an attacker need credentials or prior access?
No. A remote unauthenticated attacker can trigger the issue by submitting a crafted JWE to an application that decrypts it using one of the affected AES-KW algorithms.
What is the impact of successful exploitation?
The crafted encrypted_key can cause an out-of-bounds heap write while cjose unwraps it into the CEK buffer. This can crash the application and may have further memory-corruption impact depending on heap layout and allocator behavior.
What can be done before upgrading?
Reject A128KW, A192KW, and A256KW for untrusted JWEs at the application layer. Upgrading to cjose 0.6.2.5 provides the patch.