# CVE-2016-9123: Square go-jose integer overflow in CBC-HMAC decryption

Source: https://junglewise.ai/threats/cve-2016-9123-square-go-jose-integer-overflow-in-cbc-hmac-decryption  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2021-06-23. Updated: 2026-07-06  
License: CC BY 4.0 with a link back

CVE-2016-9123 · Severity: high · CVSS 7.5 · Published 2021-06-23

A vulnerability exists in the go-jose library, which is used to implement encryption and digital signatures in Go applications. On 32-bit systems, an attacker could bypass security checks for encrypted messages, potentially allowing them to modify data without detection. This could lead to unauthorized changes in sensitive information or system configurations.

Technologies: [github.com/square/go-jose (Go)](https://junglewise.ai/threats/technologies/github-com-square-go-jose). Vendors: [Go](https://junglewise.ai/threats/vendors/go).

## Quick answers

**Is CVE-2016-9123 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2016-9123 being exploited in the wild.

**How severe is CVE-2016-9123?** High severity, with a CVSS score of 7.5, published 23 June 2021.

**Which products and versions are affected?** github.com/square/go-jose (Go) < 0.0.0-20160903044734-789a4c4bd4c1, SEMVER:introduced=0,fixed=0.0.0-20160903044734-789a4c4bd4c1.

**Is there a fix for CVE-2016-9123?** Yes. github.com/square/go-jose (Go): upgrade to 0.0.0-20160903044734-789a4c4bd4c1 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2016-9123 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2016-9123?** Check whether you run github.com/square/go-jose (Go) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- github.com/square/go-jose (Go): upgrade to 0.0.0-20160903044734-789a4c4bd4c1 or later

  ```sh
  go get github.com/square/go-jose@v0.0.0-20160903044734-789a4c4bd4c1
  ```


## Technical details

An integer overflow vulnerability (CWE-190) exists in the go-jose library when processing CBC-HMAC encrypted ciphertexts on 32-bit architectures. The flaw occurs during the decryption process, where a calculation error can lead to an authentication bypass. A remote, unauthenticated attacker can exploit this by providing specially crafted ciphertexts, allowing them to bypass integrity checks. This issue was addressed in version 1.0.5 by improving integer handling during tag verification.

## Affected products

- Square go-jose < 1.0.5

## Identifiers

- CVE-2016-9123
- GHSA-3fx4-7f69-5mmg
- GO-2020-0009

## Timeline

- 2016-09-03: patched: Fix committed to repository
- 2016-11-03: disclosed: Public disclosure on oss-security list
- 2017-03-28: advisory: NVD published CVE-2016-9123
- 2021-06-23: advisory: GitHub Advisory published

## References

- [https://api.github.com/users/cookesan](https://api.github.com/users/cookesan)
- [https://github.com/cookesan](https://github.com/cookesan)
- [https://api.github.com/users/cookesan/gists%7B/gist_id%7D](https://api.github.com/users/cookesan/gists%7B/gist_id%7D)
- [https://api.github.com/users/cookesan/repos](https://api.github.com/users/cookesan/repos)
- [https://avatars.githubusercontent.com/u/6601329?v=4](https://avatars.githubusercontent.com/u/6601329?v=4)
- [https://api.github.com/users/cookesan/events%7B/privacy%7D](https://api.github.com/users/cookesan/events%7B/privacy%7D)

## Related threats

- [GO-2025-3485 - DoS in go-jose Parsing in github.com/go-jose/go-jose](https://junglewise.ai/threats/cve-2025-27144-dos-in-go-jose-parsing)
- [Decryption of malicious PBES2 JWE objects can consume unbounded system resources](https://junglewise.ai/threats/decryption-of-malicious-pbes2-jwe-objects-can-consume-unbounded-system-597d0776)
- [GO-2023-2334 - Denial of service via decryption of malicious PBES2 JWE objects in github.com/go-jose/go-jose/v3](https://junglewise.ai/threats/go-2023-2334-denial-of-service-via-decryption-of-malicious-pbes2-jwe-09709de5)
- [GO-2020-0011 - When decrypting JsonWebEncryption objects with multiple recipients or JsonWebSignature objects with…](https://junglewise.ai/threats/go-2020-0011-when-decrypting-jsonwebencryption-objects-with-multiple-47870cc3)
- [GO-2020-0010 - Elliptic curve key disclosure in github.com/square/go-jose](https://junglewise.ai/threats/cve-2016-9121-elliptic-curve-key-disclosure-in-go-jose)
