Repository navigation
Commit a6f592b
committed
fix(workspace): address harness-bot round 8 — Host header, close sockets, pin marker semantics
Three findings on the browser-handoff + sidebar surfaces:
1. DNS-rebinding guard on the callback listener. Binding to 127.0.0.1 is
necessary but not sufficient: a malicious page whose hostname resolves
to 127.0.0.1 can drive the browser to attacker.com:7317/workspace-bound
and the socket lands on our listener with Host: attacker.com. State
validation catches it eventually, but rejecting the request on Host
mismatch kills the attack before touching state.
(altimate-harness-bot #1100 comment 3837907679.)
2. server.close() leaves keep-alive sockets open. Follow every close()
with server.closeAllConnections?.() (Node 18.2+, safe with the
optional-call guard).
(altimate-harness-bot #1100 comment 3837907954.)
3. Sidebar `(pinned via --workspace)` label — clarified semantics with a
code comment (option b of the review). Known imprecision is accepted;
getResolvedWorkspaceId() already encodes "was passed AND resolved" at
the env-var level, so the pin never falsely appears for a session that
wasn't launched with --workspace.
(altimate-harness-bot #1100 comment 3837908331.)1 parent fe55cf7 commit a6f592b
2 files changed
Lines changed: 37 additions & 0 deletions
File tree
- packages/opencode/src
- altimate/workspace
- plugin/tui/altimate
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
204 | 217 | | |
205 | 218 | | |
206 | 219 | | |
| |||
333 | 346 | | |
334 | 347 | | |
335 | 348 | | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
336 | 355 | | |
337 | 356 | | |
338 | 357 | | |
| |||
409 | 428 | | |
410 | 429 | | |
411 | 430 | | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
412 | 436 | | |
413 | 437 | | |
414 | 438 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
102 | 115 | | |
103 | 116 | | |
104 | 117 | | |
| |||
0 commit comments