CVE-2024-7625: Github.com/hashicorp/nomad Nomad Vulnerable To Allocation Directory Vulnerability

MODERATE
Advisory Identifier: GHSA-25qx-vfw2-fw8r
CVSS 5.8
CWE-610
Published
Advisory Summary

CVE-2024-7625 is a MODERATE (CVSS 5.8) nomad vulnerable to allocation directory vulnerability (CWE-610: Externally Controlled Reference to a Resource in Another Sphere) affecting Github.com/hashicorp/nomad libraries in the Go ecosystem. The issue involves nomad vulnerable to allocation directory escape on non-existing file paths through archive unpacking. Remediation is available by upgrading affected packages to version 1.6.14, 1.7.11, 1.8.3.

CVE-2024-7625 at a Glance

CVE Identifier CVE-2024-7625
GHSA Identifier GHSA-25qx-vfw2-fw8r
Severity MODERATE
CVSS v3.1 Base Score 5.8
CWE Classification CWE-610: Externally Controlled Reference to a Resource in Another Sphere
Affected Product Github.com/hashicorp/nomad
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 5.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:N/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required High (PR:H)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality None (C:N)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2024-7625

To remediate this vulnerability, upgrade all affected Github.com/hashicorp/nomad dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/hashicorp/nomad fixed: 1.6.14
Upgrade github.com/hashicorp/nomad to 1.6.14
github.com/hashicorp/nomad fixed: 1.7.11
Upgrade github.com/hashicorp/nomad to 1.7.11
github.com/hashicorp/nomad fixed: 1.8.3
Upgrade github.com/hashicorp/nomad to 1.8.3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/hashicorp/nomad

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-7625, inspect your project dependencies for Github.com/hashicorp/nomad:

inspect dependencies for github.com/hashicorp/nomad

Analyze the terminal output to locate any version of Github.com/hashicorp/nomad in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.6.14), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-610: Externally Controlled Reference to a Resource in Another Sphere, where the product uses an externally controlled name or reference that resolves to a resource that is outside of the intended control sphere. In Github.com/hashicorp/nomad, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

In HashiCorp Nomad and Nomad Enterprise from 0.6.1 up to 1.6.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.

CVE-2024-7625 Affected Github.com/hashicorp/nomad Versions

3 component(s)
Fixed Versions:
1.6.141.7.111.8.3
Product / Package Ecosystem Affected Versions Fixed Version
github.com/hashicorp/nomad
Go
≥ 0.6.1
< 1.6.14
1.6.14
github.com/hashicorp/nomad
Go
≥ 1.7.0
< 1.7.11
1.7.11
github.com/hashicorp/nomad
Go
≥ 1.8.0
< 1.8.3
1.8.3

References

Frequently Asked Questions

What is CVE-2024-7625?
CVE-2024-7625 is a security vulnerability in Github.com/hashicorp/nomad involving Nomad Vulnerable to Allocation Directory Escape On Non-Existing File Paths Through Archive Unpacking under CWE-610: Externally Controlled Reference to a Resource in Another Sphere.
Which Github.com/hashicorp/nomad versions are affected?
Affected versions include releases prior to 1.6.14, 1.7.11, 1.8.3 across affected packages: github.com/hashicorp/nomad.
What version fixes CVE-2024-7625?
Upgrading to 1.6.14, 1.7.11, 1.8.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/hashicorp/nomad affected?
Yes, github.com/hashicorp/nomad is affected in releases prior to 1.6.14, 1.7.11, 1.8.3. Upgrade your dependency to 1.6.14, 1.7.11, 1.8.3 or later.
What is the CVSS score of CVE-2024-7625?
CVE-2024-7625 has a CVSS v3.1 base score of 5.8 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:N/I:H/A:N.
What CWE is associated with CVE-2024-7625?
CVE-2024-7625 is classified under CWE-610: Externally Controlled Reference to a Resource in Another Sphere (The product uses an externally controlled name or reference that resolves to a resource that is outside of the intended control sphere.).
How can I check Go dependencies for CVE-2024-7625?
Run the dependency tree command: 'inspect dependencies for github.com/hashicorp/nomad'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-25qx-vfw2-fw8r",
  "modified" : "2024-09-25T19:27:54Z",
  "published" : "2024-08-15T00:30:59Z",
  "aliases" : [ "CVE-2024-7625" ],
  "summary" : "Nomad Vulnerable to Allocation Directory Escape On Non-Existing File Paths Through Archive Unpacking",
  "details" : "In HashiCorp Nomad and Nomad Enterprise from 0.6.1 up to 1.6.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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:N/I:H/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:H/AT:N/PR:H/UI:N/VC:N/VI:N/VA:N/SC:N/SI:H/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/hashicorp/nomad"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.6.1"
      }, {
        "fixed" : "1.6.14"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/hashicorp/nomad"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.7.0"
      }, {
        "fixed" : "1.7.11"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/hashicorp/nomad"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.8.0"
      }, {
        "fixed" : "1.8.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-7625"
  }, {
    "type" : "WEB",
    "url" : "https://discuss.hashicorp.com/t/hcsec-2024-17-nomad-vulnerable-to-allocation-directory-escape-on-non-existing-file-paths-through-archive-unpacking/69293"
  }, {
    "type" : "PACKAGE",
    "url" : "github.com/hashicorp/nomad"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-610" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-08-15T21:24:57Z",
    "nvd_published_at" : "2024-08-15T00:15:13Z"
  }
}