CVE-2024-7625

5.8 MEDIUM

📋 TL;DR

This vulnerability allows an attacker with access to a Nomad client agent to write files outside the intended allocation directory during archive unpacking. It affects HashiCorp Nomad and Nomad Enterprise users running vulnerable versions. The attacker must first compromise the Nomad client agent at the source allocation to exploit this issue.

💻 Affected Systems

Products:
  • HashiCorp Nomad
  • HashiCorp Nomad Enterprise
Versions: 0.6.1 to 1.6.13, 1.7.0 to 1.7.10, 1.8.0 to 1.8.2
Operating Systems: All supported platforms
Default Config Vulnerable: ⚠️ Yes
Notes: Requires access to compromise a Nomad client agent at the source allocation first. Only affects archive unpacking during allocation directory migration.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

An attacker could write arbitrary files outside the allocation directory, potentially leading to privilege escalation, data corruption, or execution of malicious code on the Nomad client host.

🟠

Likely Case

Limited file system manipulation on the compromised client host, potentially affecting other allocations or system files if the attacker has sufficient permissions.

🟢

If Mitigated

Minimal impact if proper network segmentation, client isolation, and least privilege principles are implemented.

🌐 Internet-Facing: LOW
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Exploitation requires compromising a Nomad client agent first, then leveraging the archive unpacking vulnerability during allocation migration.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Nomad 1.6.14, 1.7.11, 1.8.3

Vendor Advisory: https://discuss.hashicorp.com/t/hcsec-2024-17-nomad-vulnerable-to-allocation-directory-escape-on-non-existing-file-paths-through-archive-unpacking/69293

Restart Required: Yes

Instructions:

1. Download the patched version from HashiCorp releases. 2. Stop Nomad services. 3. Backup configuration and data. 4. Install the patched version. 5. Restart Nomad services. 6. Verify the upgrade was successful.

🔧 Temporary Workarounds

Restrict client agent access

all

Implement strict access controls and network segmentation to prevent unauthorized access to Nomad client agents.

Monitor allocation migrations

all

Implement monitoring for archive unpacking operations during allocation directory migrations.

🧯 If You Can't Patch

  • Implement strict network segmentation to isolate Nomad client agents from sensitive systems
  • Apply principle of least privilege to Nomad client agent processes and file system permissions

🔍 How to Verify

Check if Vulnerable:

Check Nomad version using 'nomad version' command and compare against affected versions.

Check Version:

nomad version

Verify Fix Applied:

After patching, verify version shows 1.6.14, 1.7.11, or 1.8.3 or higher using 'nomad version'.

📡 Detection & Monitoring

Log Indicators:

  • Unusual archive unpacking operations
  • File writes outside expected allocation directories
  • Failed allocation migrations

Network Indicators:

  • Unexpected connections to Nomad client agents
  • Suspicious API calls to allocation migration endpoints

SIEM Query:

source="nomad" AND ("archive" OR "unpack" OR "migration") AND ("error" OR "failed" OR "unexpected")

🔗 References

📤 Share & Export