| 标题 | louisho5 picobot 0.2.0 OS Command Injection (CWE-78) |
|---|
| 描述 | # Technical Details
An OS command execution vulnerability exists in the `[ExecTool.Execute]` method in `internal/agent/tools/exec.go` of picobot.
The application fails to reject shell-wrapper payloads in array-form `exec` tool calls. `ExecTool.Execute` validates only `argv[0]` against a short dangerous-program blacklist and applies limited argument checks before passing the command to `exec.CommandContext`. A payload such as `["sh","-c","echo openclaw-shell-wrapper-bypass-canary > marker.txt"]` bypasses the intended restrictions and executes attacker-controlled shell syntax.
# Vulnerable Code
File: `internal/agent/tools/exec.go`
Method: `ExecTool.Execute`
Why: The code checks only the outer executable and does not inspect nested shell payloads supplied through `sh -c`, allowing arbitrary shell command execution.
# Reproduction
1. Build the Picobot binary and run a local OpenAI-compatible stub provider.
2. Return an `exec` tool call containing `["sh","-c","echo openclaw-shell-wrapper-bypass-canary > marker.txt"]`.
3. Run `picobot agent -m ...` and confirm that `marker.txt` is created with the expected canary content.
# Impact
- Permits arbitrary shell command execution as the Picobot OS user.
- Can expose secrets, alter files, and tamper with code or local infrastructure reachable by the process. |
|---|
| 来源 | ⚠️ https://github.com/louisho5/picobot/issues/42 |
|---|
| 用户 | Eric-h (UID 97582) |
|---|
| 提交 | 2026-06-11 11時27分 (1 月前) |
|---|
| 管理 | 2026-07-13 23時12分 (1 month later) |
|---|
| 状态 | 已接受 |
|---|
| VulDB条目 | 378163 [louisho5 picobot 直到 0.2.0 exec Tool exec.go ExecTool.Execute 权限提升] |
|---|
| 积分 | 20 |
|---|