Repository navigation
fix(api): exec streams open within 10 seconds, rechecked, and waiting input is dropped at the end - #494
Merged
Conversation
Ending a session did not empty the frames waiting for the agent, so stdin typed before a sign-out, a loss of access or a browser leaving reached the command before it was stopped (#479). Whatever the end, the waiting frames are dropped and the agent's next frame stops the command. Closes #479 Signed-off-by: samuel mbabhazi <[email protected]>
… again before it joins An agent could open an ExecStream and stay silent before its first frame, holding the stream with no credential check (#478). The first frame must now come within 10 seconds, or the stream ends, and the transport's cancellation ends the wait too. The node's credential is checked again before it joins the session. Closes #478 Signed-off-by: samuel mbabhazi <[email protected]>
Signed-off-by: samuel mbabhazi <[email protected]>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 4 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
…what it should Review of #494: the check before the join had no deadline and ignored the transport's cancellation, so a stalled store held the stream and a cancelled one could still join. Both waits of the opening now share the 10-second deadline and the cancellation, a session that is not this node's is refused before any lookup, and only a refused credential is UNAUTHENTICATED: a store failure is UNAVAILABLE. Signed-off-by: samuel mbabhazi <[email protected]>
Collaborator
Author
|
Code review (high), four findings, all fixed in 69500b3:
Fleet unit tests: 157/157. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Two hardening findings from the 2026-11-25 audit on exec sessions (SPEC 3.1).
#478, opening an
ExecStream.relayExecStreamreads the first frame throughopening(), which bounds the wait toEXEC_OPEN_MS(10 s) and ends withDEADLINE_EXCEEDED.context.signal, now passed by the gateway) also ends the wait, withCANCELED. The pending read is released with the stream.stillValid) before it joins. A node removed or revoked while opening getsUNAUTHENTICATED, and the session stays joinable by a valid agent.NOT_FOUND.#479, waiting input at the end.
ExecRelay.end()now empties the frames waiting for the agent, whatever the end. The agent's next frame is the finalExecClose{kill: true}, or nothing after an exit.closedandexitedcome from the agent after the command ended, so nothing it was meant to receive is lost.browser_left, input typed just before the tab closed no longer runs before the kill. One existing test expected that and was updated.Why
A silent stream held an RPC with no credential check, and input accepted before a revocation could still reach the container after it.
How it was tested
exec-relay.spec.ts:access_removed,signed_out,time_limit,failed,browser_leftandshutdown;exec-stream.spec.ts(fake timers):gateway.integration.spec.tsagainst PostgreSQL passes (15).api:lintandapi:typecheckare clean.Security considerations
ExecSession.Closes #478
Closes #479