Summary
A command injection vulnerability in uniget allows arbitrary shell commands to be executed when metadata is processed with /bin/bash -c using unvalidated input from the check field.
If an attacker can supply or influence JSON metadata consumed by uniget, they can trigger arbitrary code execution during routine operations like describe, install, update, or inspect, running with the privileges of the invoking user.
Affected context
This vulnerability affects environments where uniget is used to install or manage (container) tools and relies on external or potentially untrusted JSON metadata files.
The issue arises when the check field in these metadata files is treated as a shell snippet and executed directly via /bin/bash -c on the client system.
Systems are most exposed when metadata is fetched from remote sources, mirrors, or registries that are not strongly authenticated or integrity-protected, or when local metadata can be modified by other users or processes.
Exploit preconditions
- Attack surface: Local uniget client processing JSON metadata for tools.
- Required access: Ability to supply, alter, or intercept uniget metadata (e.g., hosting a malicious metadata source, modifying local cache, or influencing registry content).
- Trigger point: Execution of uniget commands that read and evaluate the
checkfield, such asdescribe,install,update, orinspect. - Why exploitation is possible: The
checkfield content from JSON is passed directly to/bin/bash -cwithout validation, sanitization, or restriction, allowing arbitrary command chains to be executed in the user's shell context.
Why this happens
The underlying bug falls under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
The design assumes the check field in JSON metadata is trusted shell code and passes it unmodified to /bin/bash -c. This blends data and executable commands, allowing attackers to inject shell metacharacters, additional commands, or entirely different payloads.
Because no strict command construction, argument escaping, or whitelisting is applied, the shell interprets attacker-controlled content as part of the command line, enabling arbitrary OS command execution whenever uniget evaluates the metadata.
Potential impact
- Execution of arbitrary commands on the victim system with the privileges of the user running uniget.
- Installation of backdoors, malware, or unauthorized tools.
- Unauthorized modification or exfiltration of local files accessible to the user.
- Lateral movement within the user's environment (e.g., accessing local Docker, Kubernetes, or cloud CLIs configured on the system).
- Compromise of CI/CD pipelines or build environments that rely on uniget for tooling.
General mitigation guidance
Effective mitigation focuses on separating untrusted data from command execution and minimizing shell usage:
- Treat metadata as data only; avoid executing fields like
checkdirectly in a shell. - Prefer invoking specific binaries with parameterized arguments using safe APIs (e.g., exec-style functions or language-native process execution) that do not perform shell interpretation.
- If shell usage is unavoidable, strictly constrain allowed commands using fixed templates, whitelists, and argument validation, refusing or ignoring unexpected content.
- Introduce schema validation for metadata, ensuring the
checkfield follows a narrow, well-defined format and rejecting entries that deviate. - Run uniget under the principle of least privilege (e.g., non-root accounts, constrained sudo rules, and restricted access to sensitive directories) to limit blast radius if misuse occurs.
- Encourage deployment policies that use authenticated and integrity-checked metadata sources to reduce the chance of tampering.
How teams detect issues like this
Detecting this class of vulnerability typically involves:
- Static analysis: Scanning source code for patterns like passing user or metadata fields directly into
/bin/bash -c,system, or other shell-executing APIs, especially where interpolation or concatenation is present. - Code review cues: Flagging any feature where configuration, metadata fields, or user input is used as part of a shell command, and verifying that such input is either eliminated or strictly constrained.
- Policy enforcement: Establishing guidelines that discourage generic shell execution in tooling, supplemented by automated checks in CI pipelines to block new instances of shell-based command construction from untrusted data.
- Runtime monitoring: Using audit logs, EDR, or command-logging facilities to alert on unexpected shell executions originating from uniget processes, especially if they invoke unrelated system utilities or network tools.

