Commit 9e1997b
committed
mcp(fix[middleware]): redact respawn shell payloads
Add `shell` to `_SENSITIVE_ARG_NAMES` so respawn_pane's shell argument
is replaced by `{len, sha256_prefix}` in the audit log, matching the
existing treatment of `keys`, `text`, `value`, and `content`. An agent
that passes `shell="psql -U user -W secret"` would otherwise leak the
credential to long-lived audit archives.
Extend test_summarize_args_redacts_sensitive_keys to cover both `shell`
and `content` (the latter was already in the redaction set in code but
the test didn't exercise it). Update the safety doc's redaction list to
match the code (was: `keys`, `text`, `value`; now: `keys`, `text`,
`value`, `content`, `shell`).
Note for the threat model: redaction protects the MCP audit log, not
the OS process table or tmux's `pane_current_command` metadata. The
new safety subsection (1.C) documents the brief leakage window between
respawn-pane invocation and the spawned shell taking over.1 parent bec9ab1 commit 9e1997b
4 files changed
Lines changed: 24 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
31 | 40 | | |
32 | 41 | | |
33 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
107 | 114 | | |
108 | 115 | | |
109 | 116 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| 152 | + | |
| 153 | + | |
152 | 154 | | |
153 | 155 | | |
154 | 156 | | |
155 | 157 | | |
156 | | - | |
| 158 | + | |
157 | 159 | | |
158 | 160 | | |
159 | 161 | | |
| |||
0 commit comments