Cloudanix VulnDB

CVE-2024-7625

Medium · 5.8

CVSS

5.8

EPSS

0.3%

Published

Aug 15, 2024

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A problem in how job data gets moved between servers can let someone who already broke into one server write files in places they should not on another server.

Chainable
Exploitation
Remote Authenticated
Attacker needs
High Privilege
Complexity
High
Impact
Data Tampering
Component
Application
Class
Path Traversal
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

The archive unpacking logic during allocation directory migration accepts multiple headers targeting the same file, permitting writes outside the intended allocation directory on the Nomad client.

Why it matters to the business

Attackers who already control a source client can tamper with files on other clients during job migrations, risking integrity of workloads and potential lateral movement within the orchestration environment.

How an attack unfolds

An attacker first obtains access to the Nomad client agent at the source allocation, then triggers or waits for an allocation migration that ships an archive containing duplicate headers for the same target file, causing the unpacker to write content outside the allocation directory on the destination client.

How to fix it

Upgrade HashiCorp Nomad to 1.6.14, 1.7.11, or 1.8.3. The listed podman packages on AlmaLinux 9 should be updated to 2:4.2.0-7.el9_1 where present in the environment.

How to confirm the fix worked

Confirm the running Nomad binary reports one of the fixed versions, review the archive unpacking code path for duplicate-header handling, and test migration of allocations containing crafted archives.

Typical attack path

  1. Compromise the Nomad client agent at the source allocation
  2. Trigger or observe an allocation migration event
  3. Supply an archive whose headers reference the same file multiple times
  4. Achieve unauthorized file writes on the destination client outside the allocation directory

How to detect it

Review Nomad client logs for allocation migration events, inspect file-system changes during migrations for writes outside expected directories, and correlate with source-client compromise indicators.

What your security team should do

  • Prioritize upgrade of all Nomad clients and servers to the fixed releases
  • Restrict access to Nomad client agents and monitor for anomalous migration activity
  • Audit allocation migration logs for unexpected file operations outside allocation directories

The record

In HashiCorp Nomad and Nomad Enterprise from 0.6.1 up to 1.16.13, 1.7.10, and 1.8.2, the archive unpacking process is vulnerable to writes outside the allocation directory during migration of allocation directories when multiple archive headers target the same file. This vulnerability, CVE-2024-7625, is fixed in Nomad 1.6.14, 1.7.11, and 1.8.3. Access or compromise of the Nomad client agent at the source allocation first is a prerequisite for leveraging this vulnerability.

Affected packages

Ecosystem Package Introduced Fixed
Go github.com/hashicorp/nomad 0.6.1 1.8.3
Go github.com/hashicorp/nomad 0.6.1 1.6.14
Go github.com/hashicorp/nomad 1.7.0 1.7.11
Go github.com/hashicorp/nomad 1.8.0 1.8.3
Ubuntu:18.04:LTS nomad 0 No fix
Ubuntu:20.04:LTS nomad 0 No fix
Ubuntu:Pro:18.04:LTS nomad 0 No fix
Ubuntu:Pro:20.04:LTS nomad 0 No fix
go github.com/hashicorp/nomad 0.6.1 1.6.14
go github.com/hashicorp/nomad 1.7.0 1.7.11
go github.com/hashicorp/nomad 1.8.0 1.8.3

Related vulnerabilities