Skip to content

fix: handle error event on SSH agent socket to prevent Node crash#22090

Merged
spypsy merged 1 commit into
merge-train/spartanfrom
spyros/a-802-audit-145-ssh-agent-socket-never-handles-error-event-crashes
Mar 30, 2026
Merged

fix: handle error event on SSH agent socket to prevent Node crash#22090
spypsy merged 1 commit into
merge-train/spartanfrom
spyros/a-802-audit-145-ssh-agent-socket-never-handles-error-event-crashes

Conversation

@spypsy

@spypsy spypsy commented Mar 27, 2026

Copy link
Copy Markdown
Member

Both getIdentities() and signWithAgent() in ssh_agent.ts create a net.Socket but never register an error event handler. When the connection to the SSH agent fails (e.g. SSH_AUTH_SOCK points to a stale socket), the socket emits an error event with no listener, causing Node.js to throw an unhandled exception and crash the process.

The fix adds stream.on('error', reject) to both promise constructors, so connection errors are correctly propagated as rejected promises instead of crashing the process.

Fixes A-802

Made with Cursor

…802)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Made-with: Cursor
@spypsy spypsy marked this pull request as ready for review March 27, 2026 10:58
@spypsy spypsy merged commit 49661c1 into merge-train/spartan Mar 30, 2026
16 checks passed
@spypsy spypsy deleted the spyros/a-802-audit-145-ssh-agent-socket-never-handles-error-event-crashes branch March 30, 2026 15:13
github-merge-queue Bot pushed a commit that referenced this pull request Mar 30, 2026
BEGIN_COMMIT_OVERRIDE
chore: setup snapshot retention rules (#22107)
fix: add branding to Buffer16 and Buffer32 to prevent cross-type misuse
(#22128)
chore: (A-723) redact beacon api key in debug path (#22115)
fix(archiver): use Buffer16.ZERO for rolling hash fallback in L1
synchronizer (#22133)
feat(pipeline): allow syncing blocks ontop of the proposed chain
(#21025)
fix(logger): no arbitrary long logger module name (#22143)
chore: setup workload identity for ESO (#22137)
fix: Make test more robust to committee selection. (#22139)
fix: handle error event on SSH agent socket to prevent Node crash
(#22090)
fix: disable SponsoredFPC on staging-public (#22150)
fix(archiver): swallow error when rollup contract not yet finalized on
L1 (#22156)
chore: update dashboard (#22157)
chore: switch testnet back to prod resource profile (#22159)
chore: nightly scenario deployments should not be triggered by older
images (#22148)
END_COMMIT_OVERRIDE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants