You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
server: a secret's authority is not rechecked for a replaced pty or a role switch during the screen read #589
From the Codex adversarial pass on #588 (finding 2 there), confirmed by the reviewer by reading the code; not reproduced with a test yet. Older than #588, and outside what that PR fixes (a sender that detached and rejoined a shared attachment).
The secret handler in server/index.ts awaits a live-screen read (pane.read) before it types the secret. After the read it re-checks the connection, the attachment identity and membership, readiness, and (from #588) the sender's attach claim. Two things can still change during the read without failing those checks:
The pane's pty is replaced under the same attachment (a live handoff after a herdr update), so attachment.pty.write goes to a pty other than the one the sender saw.
The sender switches interact -> observe -> interact while the read is pending; the mode check passes again on the way back.
In both cases it is still the same pane and the sender's own submitted secret, and the prompt is validated on the live screen, so the exposure is small; the point is that the authority to type is not the one captured when the secret was accepted.
Suggested fix: capture the pty identity and a role generation with the claim when the secret is accepted, and compare all of them after the read (answer input_not_ready / read_only). Add contract cases next to the detach/rejoin one #588 adds in server/submit.contract.test.ts.
One more window, from the pre-release Codex (gpt-6-astra) review of v0.4.0..6993563, confirmed by reading the code (not reproduced with a test here):
On a mirrored pane the secret handler re-checks the sender's claim after the screen read (#588), but not between paneSendText(secret) and paneSendKeys(["Enter"]) (server/index.ts, the attachment.mirror branch). A sender that detaches and rejoins a still-alive attachment while the text RPC is pending gets its Enter sent anyway, and the answer is ok: true.
In the #588 review this was judged not worth blocking on: once the text is in the prompt, withholding Enter leaves the secret typed there for whoever presses Enter next. The fix belongs with the rest of this issue: carry one captured authority (claim, pty identity, role generation) through the whole send, and if it changes after the text, clear the line rather than leave the secret in it.
Activity
devswha commentedon Oct 8, 2026
One more window, from the pre-release Codex (gpt-6-astra) review of v0.4.0..6993563, confirmed by reading the code (not reproduced with a test here):
On a mirrored pane the
secrethandler re-checks the sender's claim after the screen read (#588), but not betweenpaneSendText(secret)andpaneSendKeys(["Enter"])(server/index.ts, theattachment.mirrorbranch). A sender that detaches and rejoins a still-alive attachment while the text RPC is pending gets its Enter sent anyway, and the answer isok: true.In the #588 review this was judged not worth blocking on: once the text is in the prompt, withholding Enter leaves the secret typed there for whoever presses Enter next. The fix belongs with the rest of this issue: carry one captured authority (claim, pty identity, role generation) through the whole send, and if it changes after the text, clear the line rather than leave the secret in it.
fix: pre-release review fixes from the second Codex pass (#592)
fix(terminal): recheck the sender's right to type right before herdr …
chore: sync with upstream devswha/herdr-web-ui main (devswha#624, dev…
devswha commentedon Oct 12, 2026
The parts of this issue that main already covers are done. The remaining work moves to #900, so this issue can close.