OpenHuman desktop agent shell tool sandbox bypass leads to arbitrary command execution
Description
The shell tool command allowlist in the SecurityPolicy of OpenHuman desktop agent through 0.54.0 (default Supervised security policy) can be bypassed to execute arbitrary OS commands with the privileges of the desktop user. Two flaws in src/openhuman/security/policy.rs combine: (1) is_args_safe() blocks the find flags -exec and -ok but not the functionally identical -execdir and -okdir, which also execute an arbitrary command for each matched file; and (2) skip_env_assignments() strips leading inline KEY=value environment-variable assignments before allowlist validation, so a command such as GIT_EXTERNAL_DIFF= git diff is validated as the allowed git diff but, when executed via the shell, runs through git's environment-driven hooks (for example GIT_EXTERNAL_DIFF or GIT_SSH_COMMAND). Because the sandbox is the primary trust boundary between untrusted LLM-processed content and the host operating system, an attacker can achieve remote code execution via indirect prompt injection: a malicious document, email, calendar event, or web page ingested by the agent instructs it to run a benign-looking allowlisted command, resulting in arbitrary command execution, data exfiltration, arbitrary file read/write, and lateral movement on the user's machine. The issue was fixed in commit 60050aa09a870f53ed7e4cd40ed41fd2860329e7 (first released in 0.54.22-staging; first stable release 0.56.0), which blocks -execdir/-okdir for find.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Affected products
1- Range: <=0.54.0
Patches
Vulnerability mechanics
Root cause
"The allowlist in `SecurityPolicy` fails to block `find` flags `-execdir`/`-okdir` and strips inline environment-variable assignments before validation, allowing an attacker to execute arbitrary OS commands through an otherwise-allowlisted command."
Attack vector
An attacker achieves remote code execution via indirect prompt injection: a malicious document, email, calendar event, or web page ingested by the OpenHuman agent instructs it to run a benign-looking allowlisted command. Because `skip_env_assignments()` strips inline environment-variable assignments before the allowlist check, a command such as `GIT_EXTERNAL_DIFF=<cmd> git diff` passes validation as the allowed `git diff` but the shell evaluates the environment prefix, causing git to spawn `<cmd>` as a subprocess. Similarly, the `find` command's `-execdir` and `-okdir` flags (not blocked by the original allowlist) execute arbitrary commands per matched file, just like the blocked `-exec` and `-ok` flags. Since the sandbox is the primary trust boundary between untrusted LLM-processed content and the host OS, this bypass yields arbitrary command execution, data exfiltration, file read/write, and lateral movement on the user's machine.
Affected code
The vulnerability resides in `src/openhuman/security/policy.rs`. Two flaws combine: (1) `is_args_safe()` blocks `find` flags `-exec` and `-ok` but not the functionally identical `-execdir` and `-okdir`; (2) `skip_env_assignments()` strips leading inline `KEY=value` environment-variable assignments before allowlist validation, so a command like `GIT_EXTERNAL_DIFF=<cmd> git diff` is validated as the allowed `git diff` but executes `<cmd>` through git's environment-driven hooks.
What the fix does
The commit [patch_id=6466960] adds two defenses. First, `has_dangerous_env_prefix()` is introduced to reject any command segment that begins with an inline assignment to a dangerous environment variable (e.g. `GIT_EXTERNAL_DIFF`, `GIT_SSH_COMMAND`, `LD_PRELOAD`, `PATH`, `SHELL`); this check runs before `skip_env_assignments()` strips the prefix, so the allowlist cannot be bypassed by hiding a hook variable in the leading assignment. Second, the `find`-flag allowlist is extended to block `-execdir` and `-okdir` alongside the already-blocked `-exec` and `-ok`, because all four flags execute an arbitrary command per matched file. Together these changes close the two bypass vectors that allowed an attacker to achieve arbitrary OS command execution through an otherwise-allowlisted command.
Preconditions
- configThe OpenHuman agent must be running with the default Supervised security policy (versions through 0.54.0).
- inputThe attacker must be able to inject a prompt into content ingested by the agent (e.g. a malicious document, email, calendar event, or web page).
- inputThe injected prompt must instruct the agent to run a command that is allowlisted but can be mutated via an inline environment-variable assignment or a `find` flag.
Generated on Jun 18, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
2News mentions
0No linked articles in our index yet.