Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(security): block env from launching command executors

Steven Enamakele11620c95891
diff --git a/crates/openhuman-core/src/security/policy/command_checks.rs b/crates/openhuman-core/src/security/policy/command_checks.rs
index 2a9ff9c531..afe81f58c6 100644
--- a/crates/openhuman-core/src/security/policy/command_checks.rs
+++ b/crates/openhuman-core/src/security/policy/command_checks.rs
@@ -662,7 +662,12 @@ impl SecurityPolicy {
// Validate arguments for the command
let args: Vec<String> = words.map(|w| w.to_ascii_lowercase()).collect();
- if is_command_executor(base_cmd) || !self.is_args_safe(base_cmd, &args) {
+ let launches_executor =
+ base_cmd == "env" && args.iter().any(|arg| is_command_executor(arg));
+ if is_command_executor(base_cmd)
+ || launches_executor
+ || !self.is_args_safe(base_cmd, &args)
+ {
return false;
}
}