CVE-2024-6257

8.4 HIGH

📋 TL;DR

CVE-2024-6257 is a vulnerability in HashiCorp's go-getter library where an attacker can manipulate Git configuration files to execute arbitrary code during Git update operations. This affects any application using the vulnerable go-getter library for Git operations. The vulnerability allows remote code execution with the privileges of the process using the library.

💻 Affected Systems

Products:
  • HashiCorp go-getter library
Versions: All versions prior to v1.7.4
Operating Systems: All platforms where go-getter is used
Default Config Vulnerable: ⚠️ Yes
Notes: Any application using go-getter's Git functionality with untrusted Git repositories is vulnerable. This includes HashiCorp products like Terraform, Packer, and Vagrant when configured to use Git sources.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full system compromise through arbitrary code execution, potentially leading to data theft, ransomware deployment, or lateral movement within the network.

🟠

Likely Case

Unauthorized code execution leading to data exfiltration, backdoor installation, or service disruption.

🟢

If Mitigated

Limited impact through network segmentation and least privilege principles, potentially only affecting isolated containers or sandboxed environments.

🌐 Internet-Facing: HIGH - Applications using go-getter to fetch external Git repositories from untrusted sources are directly exposed.
🏢 Internal Only: MEDIUM - Internal systems using go-getter with controlled Git sources have reduced but still significant risk from insider threats or compromised internal repositories.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: MEDIUM

Exploitation requires the ability to modify Git configuration files that the go-getter process will read, which could be achieved through various means including compromised repositories or supply chain attacks.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: v1.7.4

Vendor Advisory: https://discuss.hashicorp.com/t/hcsec-2024-13-hashicorp-go-getter-vulnerable-to-code-execution-on-git-update-via-git-config-manipulation/68081

Restart Required: Yes

Instructions:

1. Update go-getter dependency to v1.7.4 or later. 2. Update any HashiCorp products that embed go-getter to patched versions. 3. Restart affected services and applications.

🔧 Temporary Workarounds

Disable Git functionality

all

If Git functionality is not required, disable or remove go-getter's Git support.

Modify application configuration to use alternative protocols or disable Git sources

Restrict Git sources

all

Only allow Git operations from trusted, internal repositories.

Configure application to whitelist specific Git repositories

🧯 If You Can't Patch

  • Implement network controls to restrict outbound Git traffic to trusted repositories only
  • Run applications using go-getter with minimal privileges and in isolated containers

🔍 How to Verify

Check if Vulnerable:

Check go.mod or vendor dependencies for go-getter version <1.7.4. For HashiCorp products, check their version against security advisories.

Check Version:

go list -m github.com/hashicorp/go-getter

Verify Fix Applied:

Verify go-getter version is >=1.7.4 in dependencies. Test Git operations from known safe repositories.

📡 Detection & Monitoring

Log Indicators:

  • Unexpected Git configuration changes
  • Unusual Git operations from applications
  • Process execution from Git operations

Network Indicators:

  • Git protocol traffic to unexpected destinations
  • Unusual outbound connections following Git operations

SIEM Query:

Process creation where parent process contains 'go-getter' AND command line contains 'git'

🔗 References

📤 Share & Export