Go JOSE: Panic during CBC-HMAC processingGHSA-4w3g-jfj2-cw2q
Fix: go-jose/go-jose#292GHSA-4w3g-jfj2-cw2q is a CWE-129 vulnerability in github.com/go-jose/go-jose/v4. A fix is available for github.com/go-jose/go-jose/v4 — see the affected versions and patch details below.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
Real-World Exposure
github.com/go-jose/go-jose/v4🐹github.com/go-jose/go-jose/v3Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go packages — download data is not available via public APIs for these ecosystems.
Description
Summary
Decrypting a ciphertext with "A128CBC-HS256", "A192CBC-HS384", or "A256CBC-HS512" can result in a panic on untrusted input.
Note this advisory is the same as https://github.com/go-jose/go-jose/security/advisories/GHSA-6mp9-8xrw-74r4.
Details
Insufficient validation of parameters can lead to attempting to index into an empty buffer. See https://github.com/go-jose/go-jose/pull/292.
Workarounds
If the application does not require the CBC-HMAC modes for content encryption, and is using github.com/go-jose/go-jose/v4, do not include them in the list of ContentEncryption algorithms passed to ParseEncrypted / ParseEncryptedJSON / ParseEncryptedCompact.
Impact
Denial of service vulnerability. Any application which decrypts untrusted ciphertexts with the indicated algorithms is affected.
Acknowledgements
Thanks to Joshua Rogers of AISLE Research for reporting this problem.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐹Go | github.com/go-jose/go-jose/v4 | all versions | 4.1.5go get github.com/go-jose/go-jose/v4@v4.1.5 |
| 🐹Go | github.com/go-jose/go-jose/v3 | all versions | No fix |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for github.com/go-jose/go-jose/v4, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update github.com/go-jose/go-jose/v4 to 4.1.5 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-4w3g-jfj2-cw2q is resolved across your whole dependency graph.
Workarounds
Cap what an attacker can consume: apply request size, rate and timeout limits in front of the affected component, and run it with memory and CPU limits so exhaustion degrades one worker rather than the whole service.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
This vulnerability is rated as an Important severity flaw because an unauthenticated remote attacker can cause an immediate denial of service by triggering an unhandled panic without requiring special privileges. Within Red Hat OpenShift and hybrid cloud environments, various core management and authentication proxy…
Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base, or stability.Source: Red Hat security advisory for GHSA-4w3g-jfj2-cw2q (CC BY 4.0)
Frequently Asked Questions
Is GHSA-4w3g-jfj2-cw2q in your dependencies?
Find it across Go, including transitive dependencies.