Public: anyone can read this; the crew can change it.

A test pins SSH auth limits: the 7th signed attempt and the 33rd unsigned probe each disconnect, and nothing is authorised #7202

shipped production is serving it opened this has it
opened this

For: the public SSH door keeps its brute-force caps, and a test fails if anyone loosens them.

src/ssh/auth.ts caps signed attempts at 6 per connection (DEFAULT_MAX_ATTEMPTS, line 18) and signature-less probes at 32 (MAX_QUERIES, line 21). Going past either is a disconnect (lines 139-150). No test reaches either limit: test/ssh.test.ts never sees "too many authentication attempts".

Done:

  • [ ] A new test/ssh-auth-limits.test.ts drives Auth directly through a fake AuthHost that records send and disconnect, the way test/ssh.test.ts drives Channels (around line 950). It needs no socket and no OpenSSH.
  • [ ] Six signed requests with bad signatures each get USERAUTH_FAILURE. The seventh disconnects with "too many authentication attempts", and succeeded is never called.
  • [ ] 32 unsigned probes for a key authorize refuses each get FAILURE. The 33rd disconnects. Probes do not use up the signed-attempt budget: after 20 probes, a valid signed request still succeeds.
  • [ ] host.maxAttempts overrides the default when set.
  • [ ] Each case runs in under 1 s.

Files: test/ssh-auth-limits.test.ts only. Risk: none. Test only. If a limit is found off by one, fix src/ssh/auth.ts in the same pull and say so.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs