Files
t3mp3st/bench/cve-zero/results/hunt-GHSA-hx53-77qj-8663.json
T

1 line
4.2 KiB
JSON

{"id": "GHSA-hx53-77qj-8663", "cve": "CVE-2026-7474", "repo": "hashicorp/nomad", "cwes": ["CWE-22"], "vuln_files": ["client/hostvolumemanager/host_volume_plugin.go", "client/hostvolumemanager/host_volume_plugin_test.go", "client/hostvolumemanager/host_volumes_test.go"], "duration_sec": 95.4, "error": null, "strict": true, "lenient": true, "findings_scored": [{"fileMatch": true, "lineProx": false, "cweMatch": true, "hit": true, "title": "Path traversal in host-volume ID enables arbitrary directory deletion (RemoveAll) and creation on the client host", "file": "client/hostvolumemanager/host_volume_plugin.go", "line": 210, "cwe": "CWE-22"}, {"fileMatch": true, "lineProx": true, "cweMatch": true, "hit": true, "title": "Path traversal in PluginID selects and executes an arbitrary on-disk executable", "file": "client/hostvolumemanager/host_volume_plugin.go", "line": 229, "cwe": "CWE-22"}], "n_findings": 2, "findings": [{"title": "Path traversal in host-volume ID enables arbitrary directory deletion (RemoveAll) and creation on the client host", "file": "client/hostvolumemanager/host_volume_plugin.go", "line": 210, "cwe": "CWE-22", "vuln_class": "path-traversal", "severity": "high", "description": "The built-in 'mkdir' host-volume plugin builds the on-disk target path with path := filepath.Join(p.VolumesDir, req.ID) (lines 105 and 203) and then performs destructive filesystem operations: os.MkdirAll/os.Chmod/os.Chown in Create (lines 133-160) and os.RemoveAll(path) in Delete (line 210). req.ID originates from the ClientHostVolumeDeleteRequest/ClientHostVolumeCreateRequest forwarded verbatim to the client RPC handler (HostVolume.Create/Delete -> HostVolumeManager.Create/Delete -> getPlugin -> HostVolumePluginMkdir). Nowhere in client/hostvolumemanager is req.ID validated to reject '..' or absolute components, and filepath.Join cleans the path so a traversal like '../../../../etc' escapes VolumesDir. Because the Nomad client agent typically runs as root, a request with a traversing ID causes os.RemoveAll to recursively delete an arbitrary host directory (e.g. the volumes dir's parents, /etc, plugin dirs), and Create can chown/chmod arbitrary existing directories. This is a destructive, attacker-influenced filesystem primitive reachable from the dynamic-host-volume RPC path with no sanitizer between source and sink.", "poc": "Issue a dynamic host volume delete (or create) whose volume ID contains traversal, e.g. ClientHostVolumeDeleteRequest{PluginID:\"mkdir\", ID:\"../../../../../../etc/cron.d\", NodeID:<target>} -> client computes path=filepath.Join(VolumesDir, \"../../../../../../etc/cron.d\") and runs os.RemoveAll on it, deleting /etc/cron.d on the host. With Create, ID=\"../../../../some/existing/dir\" plus parameters {mode:777,uid:0} chmods/chowns that dir.", "confidence": 0.7}, {"title": "Path traversal in PluginID selects and executes an arbitrary on-disk executable", "file": "client/hostvolumemanager/host_volume_plugin.go", "line": 229, "cwe": "CWE-22", "vuln_class": "rce", "severity": "high", "description": "getPlugin(req.PluginID) (host_volumes.go) falls through to NewHostVolumePluginExternal(log, hvm.pluginDir, id, ...) where id == req.PluginID. The executable path is built as executable := filepath.Join(pluginDir, filename) (line 229) with no rejection of '..' or absolute path components. filepath.Join cleans the path, so a PluginID like '../../../../bin/sh' resolves to an executable outside the configured plugin directory. The only guard is os.Stat + helper.IsExecutable, so any executable file on the host can be selected and then invoked via exec.CommandContext in runPlugin/Fingerprint/Create/Delete with attacker-controlled environment variables (DHV_PARAMETERS, DHV_VOLUME_ID, etc.). The Nomad client runs this as root, allowing execution of arbitrary host binaries with attacker-influenced environment as part of volume create/delete/fingerprint.", "poc": "Send a dynamic host volume create/delete with PluginID=\"../../../../../../usr/bin/<target-binary>\" so filepath.Join(pluginDir, PluginID) resolves to an arbitrary executable, which Nomad then runs as the client process user (typically root) with attacker-controlled DHV_* env vars.", "confidence": 0.55}], "transcript": ""}