CVE-2022-30321

8.6 HIGH

📋 TL;DR

This vulnerability in the go-getter library allows attackers to perform path traversal, symlink processing, and command injection attacks, potentially leading to arbitrary file access and remote code execution. It affects applications using go-getter versions up to 1.5.11 and 2.0.2 for downloading files from remote sources. Users of HashiCorp tools like Terraform, Packer, and Vault that depend on go-getter are particularly vulnerable.

💻 Affected Systems

Products:
  • go-getter library
  • Terraform
  • Packer
  • Vault
  • Consul
  • Nomad
  • Boundary
  • Waypoint
Versions: go-getter <=1.5.11, <=2.0.2
Operating Systems: All platforms where go-getter is used
Default Config Vulnerable: ⚠️ Yes
Notes: Any application using go-getter to fetch files from URLs or SCP/SFTP/Git sources is vulnerable by default when processing untrusted inputs.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full system compromise via remote code execution, allowing attackers to execute arbitrary commands, access sensitive data, and pivot to other systems.

🟠

Likely Case

Arbitrary file read/write access leading to data exfiltration, configuration manipulation, or privilege escalation.

🟢

If Mitigated

Limited impact if proper input validation and sandboxing are implemented, potentially only affecting isolated containers or temporary files.

🌐 Internet-Facing: HIGH - Exploitable via malicious URLs or file sources processed by go-getter from untrusted inputs.
🏢 Internal Only: MEDIUM - Still exploitable via internal malicious sources or compromised internal systems.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation requires the application to process attacker-controlled URLs or file sources. The vulnerability details and proof-of-concept are publicly available in the HashiCorp advisory.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: go-getter 1.6.1, 2.1.0

Vendor Advisory: https://discuss.hashicorp.com/t/hcsec-2022-13-multiple-vulnerabilities-in-go-getter-library/39930

Restart Required: Yes

Instructions:

1. Update go-getter dependency to 1.6.1+ or 2.1.0+ in your Go modules. 2. Rebuild and redeploy affected applications. 3. For HashiCorp products, update to versions that include the patched go-getter library.

🔧 Temporary Workarounds

Input Validation and Sanitization

all

Validate and sanitize all URLs and file sources before passing to go-getter functions.

Disable Untrusted Sources

all

Configure applications to only use trusted, whitelisted sources for go-getter operations.

🧯 If You Can't Patch

  • Implement strict network controls to limit go-getter's ability to fetch from untrusted or external sources.
  • Run vulnerable applications in isolated containers with minimal privileges and filesystem access.

🔍 How to Verify

Check if Vulnerable:

Check your go.mod file for go-getter dependency version: grep 'github.com/hashicorp/go-getter' go.mod

Check Version:

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

Verify Fix Applied:

Verify go-getter version is 1.6.1+ or 2.1.0+ in go.mod and that the application rebuilds successfully.

📡 Detection & Monitoring

Log Indicators:

  • Unusual file access patterns
  • Unexpected symlink creation
  • Suspicious command execution from go-getter processes

Network Indicators:

  • Unexpected outbound connections from go-getter to unusual hosts or IPs

SIEM Query:

process_name:"terraform" OR process_name:"packer" AND (cmdline:".." OR cmdline:"/etc/passwd" OR cmdline:"/bin/sh")

🔗 References

📤 Share & Export