CVE-2022-0317: Github.com/google/go attestation Go-Attestation Improper Input Validation With Vulnerability

MODERATE
Advisory Identifier: GHSA-99cg-575x-774p
CVSS 4.0
CWE-20
Published
Advisory Summary

CVE-2022-0317 is a MODERATE (CVSS 4.0) go-attestation improper input validation with vulnerability (CWE-20: Improper Input Validation) affecting Github.com/google/go attestation libraries in the Go ecosystem. The issue involves go-attestation improper input validation with attacker-controlled tpm quote. Remediation is available by upgrading affected packages to version 0.4.0.

CVE-2022-0317 at a Glance

CVE Identifier CVE-2022-0317
GHSA Identifier GHSA-99cg-575x-774p
Severity MODERATE
CVSS v3.1 Base Score 4.0
CWE Classification CWE-20: Improper Input Validation
Affected Product Github.com/google/go attestation
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 4.0

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

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

How to Fix CVE-2022-0317

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

github.com/google/go-attestation fixed: 0.4.0
Upgrade github.com/google/go-attestation to 0.4.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 github.com/google/go-attestation

How to Check if You Are Affected

To determine whether your application is affected by CVE-2022-0317, inspect your project dependencies for Github.com/google/go attestation:

inspect dependencies for github.com/google/go-attestation

Analyze the terminal output to locate any version of Github.com/google/go attestation in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.4.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-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Github.com/google/go attestation, 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

### Impact An improper input validation vulnerability in go-attestation before 0.4.0 allows local users to provide a maliciously-formed Quote over no/some PCRs, causing `AKPublic.Verify` to succeed despite the inconsistency. Subsequent use of the same set of PCR values in `Eventlog.Verify` lacks the authentication performed by quote verification, meaning a local attacker could couple this vulnerability with a maliciously-crafted TCG log in `Eventlog.Verify` to spoof events in the TCG log, hence defeating remotely-attested measured-boot. ### Patches This issue is resolved in version 0.4.0. If your usage of this library verifies PCRs using multiple quotes, make sure to use the new method `AKPublic.VerifyAll()` instead of `AKPublic.Verify`.

CVE-2022-0317 Affected Github.com/google/go attestation Versions

1 component(s)
Fixed Versions:
0.4.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/google/go-attestation
Go
< 0.4.0
0.4.0

References

Frequently Asked Questions

What is CVE-2022-0317?
CVE-2022-0317 is a security vulnerability in Github.com/google/go attestation involving Go-Attestation Improper Input Validation with attacker-controlled TPM Quote under CWE-20: Improper Input Validation.
Which Github.com/google/go attestation versions are affected?
Affected versions include releases prior to 0.4.0 across affected packages: github.com/google/go-attestation.
What version fixes CVE-2022-0317?
Upgrading to 0.4.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/google/go-attestation affected?
Yes, github.com/google/go-attestation is affected in releases prior to 0.4.0. Upgrade your dependency to 0.4.0 or later.
What is the CVSS score of CVE-2022-0317?
CVE-2022-0317 has a CVSS v3.1 base score of 4.0 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N.
What CWE is associated with CVE-2022-0317?
CVE-2022-0317 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check Go dependencies for CVE-2022-0317?
Run the dependency tree command: 'inspect dependencies for github.com/google/go-attestation'. 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-99cg-575x-774p",
  "modified" : "2023-08-29T20:29:19Z",
  "published" : "2022-02-01T00:43:17Z",
  "aliases" : [ "CVE-2022-0317" ],
  "summary" : "Go-Attestation Improper Input Validation with attacker-controlled TPM Quote",
  "details" : "### Impact\n\nAn improper input validation vulnerability in go-attestation before 0.4.0 allows local users to provide a maliciously-formed Quote over no/some PCRs, causing `AKPublic.Verify` to succeed despite the inconsistency. Subsequent use of the same set of PCR values in `Eventlog.Verify` lacks the authentication performed by quote verification, meaning a local attacker could couple this vulnerability with a maliciously-crafted TCG log in `Eventlog.Verify` to spoof events in the TCG log, hence defeating remotely-attested measured-boot.\n\n### Patches\nThis issue is resolved in version 0.4.0. If your usage of this library verifies PCRs using multiple quotes, make sure to use the new method `AKPublic.VerifyAll()` instead of `AKPublic.Verify`.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/google/go-attestation"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.4.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/google/go-attestation/security/advisories/GHSA-99cg-575x-774p"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-0317"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/google/go-attestation/commit/82f2c9c2c76e1d3691d17ee78116d1d93a123788"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/google/go-attestation"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2022-0294"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-01-31T22:15:30Z",
    "nvd_published_at" : "2022-02-04T23:15:00Z"
  }
}