Repository navigation
Commit 571effc
committed
fix(mcp_server): deny ftp/sftp/ssh/telnet and openssl s_client
_DENY_COMMANDS covered curl/wget/scp/rsync/nc/netcat but missed several
equally capable exfiltration/remote-exec primitives:
- ftp, sftp, telnet: added directly to _DENY_COMMANDS (shared with
policy.py via import, so both the S2 chokepoint and shell.py's own
handler-level check deny them).
- ssh: same treatment. Searched mcp_server/, orchestrator/, cli/,
desktop/ for any legitimate shell-out to the ssh binary -- none
exists (the only `ssh` hits are ~/.ssh path references in the
sensitive-path deny list). An ssh call is a direct remote-exec /
exfiltration primitive, so it is denied outright rather than
downgraded to approval-required.
- openssl s_client: NOT added as a whole-binary deny, since `openssl`
has legitimate uses (cert generation, hashing). Added a narrow
argv-pattern rule to _DENY_PATTERNS instead (same treatment
`find -delete` gets instead of blocking `find` outright) that
specifically catches the `s_client` subcommand, which opens a raw
TCP connection and can pipe file contents out over it.
Full suite (tests/) green: 1978 passed, 3 skipped (pre-existing,
unrelated).1 parent a830e20 commit 571effc
3 files changed
Lines changed: 39 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
71 | 79 | | |
| 80 | + | |
72 | 81 | | |
73 | 82 | | |
74 | 83 | | |
75 | 84 | | |
76 | 85 | | |
77 | 86 | | |
78 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
79 | 95 | | |
80 | 96 | | |
81 | 97 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
215 | 219 | | |
216 | 220 | | |
217 | 221 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
450 | 450 | | |
451 | 451 | | |
452 | 452 | | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
453 | 459 | | |
454 | 460 | | |
455 | 461 | | |
| |||
467 | 473 | | |
468 | 474 | | |
469 | 475 | | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
470 | 488 | | |
471 | 489 | | |
472 | 490 | | |
| |||
0 commit comments