CVE-2026-34986
HIGH7.5EPSS 0.03%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`](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.
受影響套件(9)
- Debian/golang-github-go-jose-go-josefrom 0
- Debian/golang-github-go-jose-go-jose.v3from 0
- Debian/golang-gopkg-square-go-jose.v1from 0
- Debian/golang-gopkg-square-go-jose.v2from 0
- Go/github.com/go-jose/go-josefrom 0, <= 2.6.3
- Go/github.com/go-jose/go-jose/v3from 0, < 3.0.5
- Go/github.com/go-jose/go-jose/v3from 0, < 3.0.5
- Go/github.com/go-jose/go-jose/v4from 0, < 4.1.4
- Go/github.com/go-jose/go-jose/v4from 0, < 4.1.4
CVSS 分數
| 來源 | 版本 | 嚴重程度 | 向量 |
|---|---|---|---|
| osv | CVSS 3.1 | HIGH7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
參考連結(5)
- ADVISORYhttps://nvd.nist.gov/vuln/detail/CVE-2026-34986
- ADVISORYhttps://security-tracker.debian.org/tracker/CVE-2026-34986
- PATCHhttps://github.com/go-jose/go-jose
- WEBhttps://github.com/go-jose/go-jose/security/advisories/GHSA-78h2-9frx-2jm8
- WEBhttps://pkg.go.dev/github.com/go-jose/go-jose/v4#pkg-constants