You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Thanks to Datadog's Security team for finding this issue.
Analysis: Deterministic build failure: Renovate's dependency update for go-jose/go-jose/v4 left a missing go.sum entry required by github.com/spiffe/go-spiffe/v2, causing the build to fail with exit code 1 before any tests ran. Confidence: 0.97
⚠️ This appears to be a real bug - manual intervention needed
Analysis: Real build failure: the Renovate security-fix branch updated go-jose/go-jose/v4 but left go.sum missing the entry for github.com/go-jose/go-jose/v4 required by go-spiffe/v2@v2.6.0, causing a deterministic compile error. Confidence: 0.97
⚠️ This appears to be a real bug - manual intervention needed
Analysis: Deterministic build failure: the Renovate PR updating go-jose/go-jose/v4 did not update go.sum with the required entry for github.com/go-jose/go-jose/v4 (transitively imported by go-spiffe/v2@v2.6.0), so the build exits before any tests run. Confidence: 0.97
⚠️ This appears to be a real bug - manual intervention needed
Analysis: Build fails deterministically with "missing go.sum entry for github.com/go-jose/go-jose/v4" because the Renovate dependency-update PR did not regenerate go.sum after bumping the go-jose/v4 vulnerability fix. Confidence: 0.98
⚠️ This appears to be a real bug - manual intervention needed
Analysis: Deterministic build failure: the Renovate go-jose/v4 bump is missing a go.sum entry for github.com/go-jose/go-jose/v4 (required by go-spiffe/v2@v2.6.0), causing go build to fail before any tests execute. Confidence: 0.97
⚠️ This appears to be a real bug - manual intervention needed
Analysis: Real build failure: the Renovate PR updating go-jose for a vulnerability fix left go.sum missing an entry for github.com/go-jose/go-jose/v4 (required by github.com/spiffe/go-spiffe/v2@v2.6.0), causing the build to fail before any tests ran. Confidence: 0.98
⚠️ This appears to be a real bug - manual intervention needed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
v4.1.3→v4.1.4Go JOSE Panics in JWE decryption
CVE-2026-34986 / GHSA-78h2-9frx-2jm8
More information
Details
Impact
Decrypting a JSON Web Encryption (JWE) object will panic if the
algfield indicates a key wrapping algorithm (one ending inKW, with the exception ofA128GCMKW,A192GCMKW, andA256GCMKW) and theencrypted_keyfield is empty. The panic happens whencipher.KeyUnwrap()inkey_wrap.goattempts to allocate a slice with a zero or negative length based on the length of theencrypted_key.This code path is reachable from
ParseEncrypted()/ParseEncryptedJSON()/ParseEncryptedCompact()followed byDecrypt()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 anyciphertextparameter 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
keyAlgorithmspassed toParseEncrypted()/ParseEncryptedJSON()/ParseEncryptedCompact()does not include key wrapping algorithms (those ending inKW), your application is unaffected.If your application uses key wrapping, you can prevalidate to the JWE objects to ensure the
encrypted_keyfield 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.
Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:HReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
go-jose/go-jose (github.com/go-jose/go-jose/v4)
v4.1.4Compare Source
What's Changed
Fixes Panic in JWE decryption. See GHSA-78h2-9frx-2jm8
Full Changelog: go-jose/go-jose@v4.1.3...v4.1.4
Configuration
📅 Schedule: (in timezone Etc/UTC)
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.