CVE-2016-9122: Gopkg.in/square/go jose.v1 Go JOSE Signature Validation Bypass Vulnerability

HIGH
Advisory Identifier: GHSA-77gc-fj98-665h
CVSS 7.5
CWE-284
Published
Advisory Summary

CVE-2016-9122 is a HIGH (CVSS 7.5) go jose signature validation bypass vulnerability (CWE-284: Improper Access Control) affecting Gopkg.in/square/go jose.v1 libraries in the Go ecosystem. The issue involves go jose signature validation bypass. Remediation is available by upgrading affected packages to version 1.1.0.

CVE-2016-9122 at a Glance

CVE Identifier CVE-2016-9122
GHSA Identifier GHSA-77gc-fj98-665h
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-284: Improper Access Control
Affected Product Gopkg.in/square/go jose.v1
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2016-9122

To remediate this vulnerability, upgrade all affected Gopkg.in/square/go jose.v1 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

gopkg.in/square/go-jose.v1 fixed: 1.1.0
Upgrade gopkg.in/square/go-jose.v1 to 1.1.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for gopkg.in/square/go-jose.v1

How to Check if You Are Affected

To determine whether your application is affected by CVE-2016-9122, inspect your project dependencies for Gopkg.in/square/go jose.v1:

inspect dependencies for gopkg.in/square/go-jose.v1

Analyze the terminal output to locate any version of Gopkg.in/square/go jose.v1 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.1.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-284: Improper Access Control, where the product does not restrict or incorrectly restricts access to a resource from an unauthorized actor. In Gopkg.in/square/go jose.v1, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

Go JOSE before 1.1.0 suffers from multiple signatures exploitation. The go-jose library supports messages with multiple signatures. However, when validating a signed message the API did not indicate which signature was valid, which could potentially lead to confusion. For example, users of the library might mistakenly read protected header values from an attached signature that was different from the one originally validated

CVE-2016-9122 Affected Gopkg.in/square/go jose.v1 Versions

1 component(s)
Fixed Versions:
1.1.0
Product / Package Ecosystem Affected Versions Fixed Version
gopkg.in/square/go-jose.v1
Go
< 1.1.0
1.1.0

References

Frequently Asked Questions

What is CVE-2016-9122?
CVE-2016-9122 is a security vulnerability in Gopkg.in/square/go jose.v1 involving Go JOSE Signature Validation Bypass under CWE-284: Improper Access Control.
Which Gopkg.in/square/go jose.v1 versions are affected?
Affected versions include releases prior to 1.1.0 across affected packages: gopkg.in/square/go-jose.v1.
What version fixes CVE-2016-9122?
Upgrading to 1.1.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is gopkg.in/square/go-jose.v1 affected?
Yes, gopkg.in/square/go-jose.v1 is affected in releases prior to 1.1.0. Upgrade your dependency to 1.1.0 or later.
What is the CVSS score of CVE-2016-9122?
CVE-2016-9122 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2016-9122?
CVE-2016-9122 is classified under CWE-284: Improper Access Control (The product does not restrict or incorrectly restricts access to a resource from an unauthorized actor.).
How can I check Go dependencies for CVE-2016-9122?
Run the dependency tree command: 'inspect dependencies for gopkg.in/square/go-jose.v1'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-77gc-fj98-665h",
  "modified" : "2024-05-20T21:20:33Z",
  "published" : "2021-05-18T19:15:09Z",
  "aliases" : [ "CVE-2016-9122" ],
  "summary" : "Go JOSE Signature Validation Bypass",
  "details" : "Go JOSE before 1.1.0 suffers from multiple signatures exploitation. The go-jose library supports messages with multiple signatures. However, when validating a signed message the API did not indicate which signature was valid, which could potentially lead to confusion. For example, users of the library might mistakenly read protected header values from an attached signature that was different from the one originally validated",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "gopkg.in/square/go-jose.v1"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.1.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2016-9122"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/square/go-jose/pull/111"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/square/go-jose/commit/2c5656adca9909843c4ff50acf1d2cf8f32da7e6"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/square/go-jose/commit/789a4c4bd4c118f7564954f441b29c153ccd6a96"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/square/go-jose/commit/c7581939a3656bb65e89d64da0a52364a33d2507"
  }, {
    "type" : "WEB",
    "url" : "https://hackerone.com/reports/169629"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/square/go-jose"
  }, {
    "type" : "WEB",
    "url" : "https://www.openwall.com/lists/oss-security/2016/11/03/1"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2016/11/03/1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-284" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-05-12T18:06:40Z",
    "nvd_published_at" : null
  }
}