Commit c9eae3d
authored
SEC-010: Bound remote SSH output (#284)
## Summary
Bound hostile SSH and remote-bootstrap output before it can cause
unbounded memory retention or log amplification. The patch checks raw
line and stream bytes before retained growth; separately caps protocol
records, retained protocol bytes, diagnostic lines, redacted stderr
tails, and tunnel stderr; and preserves the complete successful
`listdir` envelope of `DIR` + 2,000 entries + `LIST-DONE`.
Repository history makes lifecycle ownership part of the security
boundary. Remote SSH (`3c234437`) deliberately uses a durable remote
Goose daemon behind a disposable local loopback tunnel; later
generation/incarnation and log-drain hardening (`baee7994`) established
stale-work rejection, resumable reconnects, and native-speed bounded
draining as constraints. This fix therefore leaves daemon lifetime and
reconnect policy unchanged. Output readers only report bounded-read
failures; the owner of the Tokio `Child` exclusively terminates and
reaps, and reader tasks finish before lifecycle/reconnect disposition.
The new established-supervisor regression exercises that same owner path
after readiness.
Remote SSH remains experiment-gated. The original feature excludes
Windows remote hosts; that is distinct from using a supported Windows
local Berd client. No current architectural law directly governs remote
subprocess output (`LAWS/README.md`, `LAWS/AGENTS.md`, `LAWS/CHAT.md`).
The registry's older generation-owned numeric-PID teardown for
disconnect/app exit is not represented as solved here. Replacing that
authority with owner cancellation or an identity-safe handle is separate
lifecycle-hardening scope.
### Related issue
N/A — no public issue was opened because the underlying report is
security-sensitive. No duplicate public issue or PR was found during the
pre-submission search.
### Testing
Validated resulting tree `33e0ac4a6e1629ad979fad825b27139e921c8d11`, now
exact head `49739fc01bf2081e9d355436429b7bf5c391a351`, on `origin/main`
`5c31189a4d55437888bb8d0f921efada827c7d86`; combined binary-diff SHA-256
`7c3b744ce3f41b0b527ef64f408861aa46a5259874cd401970709d9c5eb05c17`.
- `bin/just tauri-fmt-check` — passed
- `git diff --check origin/main...HEAD` — passed
- `bin/just tauri-check` — passed
- `bin/just clippy` — passed across all four lanes
- `bin/just tauri-test` — passed
- Readiness-timeout, pre-readiness stderr-overflow, and
established-supervisor stderr-overflow owner kill/reap/task-disposition
regressions — passed
- Three timing-sensitive shell-contract tests — 15/15 individual
repetitions passed on the prior behavior-equivalent head and 15/15 on
clean `origin/main`
- History-led Zeg Squad review — VSec Bot, Geeky, and Vuln Buster
independently returned PASS with no blocker on exact head `49739fc0` and
reproduced the tree, base, and binary-diff fingerprint
- Copilot findings addressed in the resulting tree — invalid protocol
UTF-8 has a distinct classification; task failures identify pipe and
read/write operation; an already-exited child wins over an elapsed wait
deadline; a completed stderr rejection wins over simultaneous child
exit; and the tunnel reader field reuses its task alias. Focused
regressions cover each case; fresh exact-head Copilot review recommends
approval with 0 new comments
The lifecycle runtime regressions are Unix-only because their fixtures
use `sh`, `sleep`, and `yes`. Windows receives Rust compile/test-lane
coverage; this does not claim an equivalent native Windows runtime
process-lifecycle test.
The fully concurrent app-crate suite is not clean on the baseline: the
prior behavior-equivalent head produced 957 passed / 10 failed, while
clean `origin/main` produced 945 passed / 12 failed. Both runs showed
the same unrelated layout-default and provider-config failures plus
timing-sensitive shell-contract failures; clean main had additional
failures. This is baseline-noise evidence, not a claim that the fully
concurrent suite is clean.
Signed-off-by: Olabode Olaoke <olabode@squareup.com>1 parent 183542e commit c9eae3d
4 files changed
Lines changed: 880 additions & 74 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
0 commit comments