CVE-2024-3817

9.8 CRITICAL

📋 TL;DR

HashiCorp's go-getter library is vulnerable to argument injection when executing Git commands to discover remote branches. This allows attackers to inject arbitrary arguments into Git commands, potentially leading to remote code execution. Affected users are those using go-getter v1 (not v2) to fetch Git repositories with untrusted input.

💻 Affected Systems

Products:
  • HashiCorp go-getter
Versions: All versions of go-getter v1 (go-getter/v2 is not affected)
Operating Systems: All operating systems where go-getter is used
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects go-getter v1. Applications using go-getter to fetch Git repositories from untrusted sources are vulnerable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution with the privileges of the process running go-getter, potentially leading to full system compromise.

🟠

Likely Case

Arbitrary command execution on the server, allowing data theft, lateral movement, or deployment of malware.

🟢

If Mitigated

Limited impact if running with minimal privileges, network segmentation, and input validation controls.

🌐 Internet-Facing: HIGH - If go-getter is used in internet-facing services processing user-controlled Git URLs.
🏢 Internal Only: MEDIUM - Internal systems using go-getter with untrusted inputs remain vulnerable to internal attackers.

🎯 Exploit Status

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

Exploitation requires the ability to control Git repository URLs or branch names processed by go-getter.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Update to go-getter/v2 (which is not vulnerable) or apply vendor patches for v1 if available

Vendor Advisory: https://discuss.hashicorp.com/t/hcsec-2024-09-hashicorp-go-getter-vulnerable-to-argument-injection-when-fetching-remote-default-git-branches/66040

Restart Required: Yes

Instructions:

1. Review the vendor advisory. 2. Migrate to go-getter/v2 if possible. 3. If staying on v1, apply any available patches. 4. Update dependencies and restart affected services.

🔧 Temporary Workarounds

Input Validation and Sanitization

all

Validate and sanitize all user-provided Git URLs and branch names before passing to go-getter.

Network Restrictions

all

Restrict go-getter to only fetch from trusted Git repositories using allowlists.

🧯 If You Can't Patch

  • Implement strict input validation for all Git URLs and branch names
  • Run go-getter processes with minimal privileges and in isolated environments

🔍 How to Verify

Check if Vulnerable:

Check if your application imports go-getter v1 (not v2) and uses it to fetch Git repositories.

Check Version:

Check your Go module dependencies (go.mod) for go-getter version

Verify Fix Applied:

Verify that go-getter/v2 is being used or that v1 has been updated to a patched version, and test with controlled inputs.

📡 Detection & Monitoring

Log Indicators:

  • Unusual Git command arguments in application logs
  • Failed Git operations with suspicious parameters

Network Indicators:

  • Unexpected outbound connections from go-getter processes
  • Git protocol traffic to untrusted sources

SIEM Query:

Search for process executions with git command containing unusual arguments from go-getter processes

🔗 References

📤 Share & Export