GHSA-78h2-9frx-2jm8

Suggest an improvement
Source
https://github.com/advisories/GHSA-78h2-9frx-2jm8
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/04/GHSA-78h2-9frx-2jm8/GHSA-78h2-9frx-2jm8.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-78h2-9frx-2jm8
Aliases
  • CVE-2026-34986
Related
Published
2026-04-03T03:28:56Z
Modified
2026-04-03T12:59:19.643172215Z
Severity
  • 7.5 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
Summary
Go JOSE Panics in JWE decryption
Details

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.

Database specific
{
    "nvd_published_at": null,
    "github_reviewed": true,
    "severity": "HIGH",
    "cwe_ids": [
        "CWE-248"
    ],
    "github_reviewed_at": "2026-04-03T03:28:56Z"
}
References

Affected packages

Go / github.com/go-jose/go-jose/v4

Package

Name
github.com/go-jose/go-jose/v4
View open source insights on deps.dev
Purl
pkg:golang/github.com/go-jose/go-jose/v4

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
4.1.4

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/04/GHSA-78h2-9frx-2jm8/GHSA-78h2-9frx-2jm8.json"

Go / github.com/go-jose/go-jose/v3

Package

Name
github.com/go-jose/go-jose/v3
View open source insights on deps.dev
Purl
pkg:golang/github.com/go-jose/go-jose/v3

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
3.0.5

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/04/GHSA-78h2-9frx-2jm8/GHSA-78h2-9frx-2jm8.json"

Go / github.com/go-jose/go-jose

Package

Name
github.com/go-jose/go-jose
View open source insights on deps.dev
Purl
pkg:golang/github.com/go-jose/go-jose

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Last affected
2.6.3

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/04/GHSA-78h2-9frx-2jm8/GHSA-78h2-9frx-2jm8.json"