Get a Demo

Let's Patch It!

Book a short call with one our specialists, we'll walk you through how Endor Patches work, and ask you a few questions about your environment (like your primary programming languages and repository management). We'll also send you an email right after you fill out the form, feel free to reply with any questions you have in advance!

CVE

CVE-2026-34986

Go JOSE Panics in JWE decryption
Back to all
CVE

CVE-2026-34986

Go JOSE Panics in JWE decryption

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 A128GCMKWA192GCMKW, 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

Thanks to Datadog's Security team for finding this issue.

Package Versions Affected

Package Version
patch Availability
No items found.

Automatically patch vulnerabilities without upgrading

Fix Without Upgrading
Detect compatible fix
Apply safe remediation
Fix with a single pull request

CVSS Version

Severity
Base Score
CVSS Version
Score Vector
C
H
U
7.5
-
3.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
C
H
U
0
-
3.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
C
H
U
7.5
-
3.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Related Resources

No items found.

References

https://github.com/go-jose/go-jose/security/advisories/GHSA-78h2-9frx-2jm8, https://nvd.nist.gov/vuln/detail/CVE-2026-34986, https://github.com/go-jose/go-jose, https://pkg.go.dev/github.com/go-jose/go-jose/v4#pkg-constants

Severity

7.5

CVSS Score
0
10

Basic Information

Ecosystem
Base CVSS
7.5
EPSS Probability
0.00035%
EPSS Percentile
0.10694%
Introduced Version
0,v4.0.0,v4.0.0-20231130013441-4aa0f69ce2f1,v3.0.0-rc.1,v3.0.0-20220520230150-32586461b3c4,v0.0.0-20201202045841-aead58737f04,v0.0.0-20190613231942-244b4dcd07da,v1.0.0,v0.0.0-20150116220800-238a80defe12,v0.0.0-20141219183151-114bcf4f4226,v2.0.0
Fix Available
4.1.4,3.0.5,v4.1.4,v4.0.0-20260331233350-0e59876635f3,v3.0.5,v3.0.0-20260331233350-02464163e1e8,0.4.12-r50,3.6.19-r6,3.7.13-r2,3.6.19-r7,1.32.1-r7,1.19.4-r5,1.20.2-r0,0.2.235-r0,2.6.43-r5,8.17.10-r12,9.0.8-r14,9.1.10-r8,8.17.10-r18,9.0.8-r15,9.1.10-r10,1.61.1-r0,1.14.5-r19,25.3.1-r0,2.5.0-r3,0.43.0-r7,18.10.4-r2,18.11.2-r1,18.9.6-r2,18.10.7-r1,18.10.5-r1,18.9.6-r1,18.10.1-r1,18.6.6-r6,18.8.0-r6,18.9.0-r6,18.7.2-r8,18.8.0-r7,18.9.0-r5,2.188.1-r3,11.6.14.01-r2,12.1.10.01-r2,12.2.8.01-r2,12.3.6-r1,11.6.14-r2,12.2.7-r4,1.9.3-r14,2.12.4-r34,2.13.5-r6,2.14.3-r5,2.12.4-r32,2.14.3-r6,1.26.8-r4,1.27.9-r2,1.26.8-r11,1.27.9-r5,1.2.5-r11,1.3.1-r14,1.31.6.1-r16,2.17.3-r5,2.17.3-r3,2.18.3-r6,2.19.0-r5,1.17.3-r14,1.18.2-r8,2.16.0-r11,4.0.5-r0,0.2.139-r0,4.0.3-r2,1.15.3-r10,3.7.3-r7,1.12.0-r11,2.6.14-r2,5.5.0-r4,5.5.0-r3,0_git20260405-r0,2.5.2-r3,1.9.4-r13,2.10.11-r6,2.11.11-r5,2.12.8-r1,2.11.12-r1,5.5.0-r0,0.7.31-r11,0.7.31-r9,0.149.0-r2,2.4.4-r2,17.7.20-r5,18.7.2-r6,18.6.8-r9,2.8.3-r5,1.6.2-r3,2.11.44-r0,0.69.3-r7,0.30.1-r6,0.30.1-r4,1.22.1-r10,22.0.4-r10,4.14.0-r0

Fix Critical Vulnerabilities Instantly

Secure your app without upgrading.
Fix Without Upgrading