CVE-2026-34986: Github.com/go jose/go jose/v4 Go JOSE Panics Vulnerability

HIGH
Advisory Identifier: GHSA-78h2-9frx-2jm8
CVSS 7.5
CWE-248
Published
Advisory Summary

CVE-2026-34986 is a HIGH (CVSS 7.5) go jose panics vulnerability (CWE-248: Uncaught Exception) affecting Github.com/go jose/go jose/v4 libraries in the Go ecosystem. The issue involves go jose panics in jwe decryption. Remediation is available by upgrading affected packages to version 4.1.4, 3.0.5.

CVE-2026-34986 at a Glance

CVE Identifier CVE-2026-34986
GHSA Identifier GHSA-78h2-9frx-2jm8
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-248: Uncaught Exception
Affected Product Github.com/go jose/go jose/v4
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

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

How to Fix CVE-2026-34986

To remediate this vulnerability, upgrade all affected Github.com/go jose/go jose/v4 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/go-jose/go-jose/v4 fixed: 4.1.4
Upgrade github.com/go-jose/go-jose/v4 to 4.1.4
github.com/go-jose/go-jose/v3 fixed: 3.0.5
Upgrade github.com/go-jose/go-jose/v3 to 3.0.5
github.com/go-jose/go-jose fixed: Latest secure release
Upgrade github.com/go-jose/go-jose to Latest secure release
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/go-jose/go-jose/v4

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-34986, inspect your project dependencies for Github.com/go jose/go jose/v4:

inspect dependencies for github.com/go-jose/go-jose/v4

Analyze the terminal output to locate any version of Github.com/go jose/go jose/v4 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.1.4), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-248: Uncaught Exception, where an exception is thrown from a function, but it is not caught. In Github.com/go jose/go jose/v4, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact Decrypting a JSON Web Encryption (JWE) object will panic if the `alg` field indicates a key wrapping algorithm ([one ending in `KW`](https://pkg.go.dev/github.com/go-jose/go-jose/v4#pkg-constants), 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 Thanks to Datadog's Security team for finding this issue.

CVE-2026-34986 Affected Github.com/go jose/go jose/v4 Versions

3 component(s)
Fixed Versions:
4.1.43.0.5
Product / Package Ecosystem Affected Versions Fixed Version
github.com/go-jose/go-jose/v4
Go
< 4.1.4
4.1.4
github.com/go-jose/go-jose/v3
Go
< 3.0.5
3.0.5
github.com/go-jose/go-jose
Go
≤ 2.6.3

References

Frequently Asked Questions

What is CVE-2026-34986?
CVE-2026-34986 is a security vulnerability in Github.com/go jose/go jose/v4 involving Go JOSE Panics in JWE decryption under CWE-248: Uncaught Exception.
Which Github.com/go jose/go jose/v4 versions are affected?
Affected versions include releases prior to 4.1.4, 3.0.5 across affected packages: github.com/go-jose/go-jose/v4, github.com/go-jose/go-jose/v3, github.com/go-jose/go-jose.
What version fixes CVE-2026-34986?
Upgrading to 4.1.4, 3.0.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/go-jose/go-jose/v4 affected?
Yes, github.com/go-jose/go-jose/v4 is affected in releases prior to 4.1.4. Upgrade your dependency to 4.1.4 or later.
Is github.com/go-jose/go-jose/v3 affected?
Yes, github.com/go-jose/go-jose/v3 is affected in releases prior to 3.0.5. Upgrade your dependency to 3.0.5 or later.
What is the CVSS score of CVE-2026-34986?
CVE-2026-34986 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2026-34986?
CVE-2026-34986 is classified under CWE-248: Uncaught Exception (An exception is thrown from a function, but it is not caught.).
How can I check Go dependencies for CVE-2026-34986?
Run the dependency tree command: 'inspect dependencies for github.com/go-jose/go-jose/v4'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-78h2-9frx-2jm8",
  "modified" : "2026-04-06T23:11:46Z",
  "published" : "2026-04-03T03:28:56Z",
  "aliases" : [ "CVE-2026-34986" ],
  "summary" : "Go JOSE Panics in JWE decryption",
  "details" : "### Impact\n\nDecrypting a JSON Web Encryption (JWE) object will panic if the `alg` field indicates a key wrapping algorithm ([one ending in `KW`](https://pkg.go.dev/github.com/go-jose/go-jose/v4#pkg-constants), 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`.\n\nThis 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.\n\nThis 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.\n\nPanics can lead to denial of service.\n\n### Fixed In\n\n4.1.4 and v3.0.5\n\n### Workarounds\n\nIf the list of `keyAlgorithms` passed to `ParseEncrypted()` / `ParseEncryptedJSON()` / `ParseEncryptedCompact()` does not include key wrapping algorithms (those ending in `KW`), your application is unaffected.\n\nIf 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 `.`).\n\n### Thanks\n\nThanks to Datadog's Security team for finding this issue.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/go-jose/go-jose/v4"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.1.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/go-jose/go-jose/v3"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.0.5"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/go-jose/go-jose"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "2.6.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/go-jose/go-jose/security/advisories/GHSA-78h2-9frx-2jm8"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-34986"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/go-jose/go-jose"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/github.com/go-jose/go-jose/v4#pkg-constants"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-248" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-03T03:28:56Z",
    "nvd_published_at" : "2026-04-06T17:17:11Z"
  }
}