PT-2026-30011 · Go · Github.Com/Go-Jose/Go-Jose+2

Published

2026-04-03

·

Updated

2026-04-03

·

CVE-2026-34986

CVSS v3.1

7.5

High

AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Impact

Decrypting a JSON Web Encryption (JWE) object will panic if the alg field indicates a key wrapping algorithm (one ending in KW, with the exception of A128GCMKW, A192GCMKW, and A256GCMKW) and the encrypted key field is empty. The panic happens when cipher.KeyUnwrap() in key wrap.go attempts to allocate a slice with a zero or negative length based on the length of the encrypted key.
This code path is reachable from ParseEncrypted() / ParseEncryptedJSON() / ParseEncryptedCompact() followed by Decrypt() on the resulting object. Note that the parse functions take a list of accepted key algorithms. If the accepted key algorithms do not include any key wrapping algorithms, parsing will fail and the application will be unaffected.
This panic is also reachable by calling cipher.KeyUnwrap() directly with any ciphertext parameter less than 16 bytes long, but calling this function directly is less common.
Panics can lead to denial of service.

Fixed In

4.1.4 and v3.0.5

Workarounds

If the list of keyAlgorithms passed to ParseEncrypted() / ParseEncryptedJSON() / ParseEncryptedCompact() does not include key wrapping algorithms (those ending in KW), your application is unaffected.
If your application uses key wrapping, you can prevalidate to the JWE objects to ensure the encrypted key field is nonempty. If your application accepts JWE Compact Serialization, apply that validation to the corresponding field of that serialization (the data between the first and second .).

Thanks

Go JOSE thanks Datadog's Security team for finding this issue.

Fix

Weakness Enumeration

Related Identifiers

CVE-2026-34986
GHSA-78H2-9FRX-2JM8

Affected Products

Github.Com/Go-Jose/Go-Jose
Github.Com/Go-Jose/Go-Jose/V3
Github.Com/Go-Jose/Go-Jose/V4