Advisory Database
  • Advisories
  • Dependency Scanning
  1. golang
  2. ›
  3. github.com/go-jose/go-jose/v4
  4. ›
  5. CVE-2026-34986

CVE-2026-34986: Go JOSE Panics in JWE decryption

April 3, 2026 (updated April 6, 2026)

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.

References

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

Code Behaviors & Features

Detect and mitigate CVE-2026-34986 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 4.1.4

Fixed versions

  • 4.1.4

Solution

Upgrade to version 4.1.4 or above.

Impact 7.5 HIGH

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

Learn more about CVSS

Weakness

  • CWE-248: Uncaught Exception

Source file

go/github.com/go-jose/go-jose/v4/CVE-2026-34986.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sat, 09 May 2026 12:18:05 +0000.