CVE-2023-0475: Github.com/hashicorp/go getter Data Amplification Vulnerability

MODERATE
Advisory Identifier: GHSA-jpxj-2jvg-6jv9
CVSS 4.2
CWE-409
Published
Advisory Summary

CVE-2023-0475 is a MODERATE (CVSS 4.2) data amplification vulnerability (CWE-409: Improper Handling of Highly Compressed Data (Data Amplification)) affecting Github.com/hashicorp/go getter libraries in the Go ecosystem. The issue involves data amplification in hashicorp go-getter. Remediation is available by upgrading affected packages to version 1.7.0, 2.2.0.

CVE-2023-0475 at a Glance

CVE Identifier CVE-2023-0475
GHSA Identifier GHSA-jpxj-2jvg-6jv9
Severity MODERATE
CVSS v3.1 Base Score 4.2
CWE Classification CWE-409: Improper Handling of Highly Compressed Data (Data Amplification)
Affected Product Github.com/hashicorp/go getter
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 4.2

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

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

How to Fix CVE-2023-0475

To remediate this vulnerability, upgrade all affected Github.com/hashicorp/go getter 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/hashicorp/go-getter fixed: 1.7.0
Upgrade github.com/hashicorp/go-getter to 1.7.0
github.com/hashicorp/go-getter/v2 fixed: 2.2.0
Upgrade github.com/hashicorp/go-getter/v2 to 2.2.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/hashicorp/go-getter

How to Check if You Are Affected

To determine whether your application is affected by CVE-2023-0475, inspect your project dependencies for Github.com/hashicorp/go getter:

inspect dependencies for github.com/hashicorp/go-getter

Analyze the terminal output to locate any version of Github.com/hashicorp/go getter in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.7.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-409: Improper Handling of Highly Compressed Data (Data Amplification), where the product does not handle or incorrectly handles a compressed input with a very high compression ratio that produces a large output. In Github.com/hashicorp/go getter, 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

HashiCorp go-getter up to 1.6.2 and 2.1.1 is vulnerable to decompression bombs. Fixed in 1.7.0 and 2.2.0.

CVE-2023-0475 Affected Github.com/hashicorp/go getter Versions

2 component(s)
Fixed Versions:
1.7.02.2.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/hashicorp/go-getter
Go
< 1.7.0
1.7.0
github.com/hashicorp/go-getter/v2
Go
≥ 2.0.0
< 2.2.0
2.2.0

References

Frequently Asked Questions

What is CVE-2023-0475?
CVE-2023-0475 is a security vulnerability in Github.com/hashicorp/go getter involving Data Amplification in HashiCorp go-getter under CWE-409: Improper Handling of Highly Compressed Data (Data Amplification).
Which Github.com/hashicorp/go getter versions are affected?
Affected versions include releases prior to 1.7.0, 2.2.0 across affected packages: github.com/hashicorp/go-getter, github.com/hashicorp/go-getter/v2.
What version fixes CVE-2023-0475?
Upgrading to 1.7.0, 2.2.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/hashicorp/go-getter affected?
Yes, github.com/hashicorp/go-getter is affected in releases prior to 1.7.0. Upgrade your dependency to 1.7.0 or later.
Is github.com/hashicorp/go-getter/v2 affected?
Yes, github.com/hashicorp/go-getter/v2 is affected in releases prior to 2.2.0. Upgrade your dependency to 2.2.0 or later.
What is the CVSS score of CVE-2023-0475?
CVE-2023-0475 has a CVSS v3.1 base score of 4.2 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:H/UI:R/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2023-0475?
CVE-2023-0475 is classified under CWE-409: Improper Handling of Highly Compressed Data (Data Amplification) (The product does not handle or incorrectly handles a compressed input with a very high compression ratio that produces a large output.).
How can I check Go dependencies for CVE-2023-0475?
Run the dependency tree command: 'inspect dependencies for github.com/hashicorp/go-getter'. 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-jpxj-2jvg-6jv9",
  "modified" : "2024-05-20T21:47:40Z",
  "published" : "2023-02-16T21:30:28Z",
  "aliases" : [ "CVE-2023-0475" ],
  "summary" : "Data Amplification in HashiCorp go-getter",
  "details" : "HashiCorp go-getter up to 1.6.2 and 2.1.1 is vulnerable to decompression bombs. Fixed in 1.7.0 and 2.2.0.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:H/UI:R/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/hashicorp/go-getter"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.7.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/hashicorp/go-getter/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.2.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-0475"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/hashicorp/go-getter/commit/0edab85348271c843782993345b07b1ac98912e6"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/hashicorp/go-getter/commit/78e6721a2a76266718dc92c3c03c1571dffdefdc"
  }, {
    "type" : "WEB",
    "url" : "https://discuss.hashicorp.com/t/hcsec-2023-4-go-getter-vulnerable-to-denial-of-service-via-malicious-compressed-archive/50125"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/hashicorp/go-getter"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-409" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-02-16T23:34:17Z",
    "nvd_published_at" : "2023-02-16T19:15:00Z"
  }
}