Skip to content

fix(gateway): never store an unreadable ssh install key - #326

Merged
nixuuu merged 1 commit into
devfrom
fix/ssh-install-key
Nov 7, 2026
Merged

nixuuu merged 1 commit into
devfrom
fix/ssh-install-key

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 7, 2026

Copy link
Copy Markdown
Member

ssh2's ed25519 key generation drops a leading zero byte of the public key about once in 256 keys (83 of 20,000) and writes a private key that neither ssh2 nor OpenSSH can read (Malformed OpenSSH private key). The gateway uses it for each owner's SSH install key, so an affected owner's SSH worker installs fail until the key is rotated.

A generated pair that doesn't parse is now generated again (apps/gateway/src/core/ssh-keys.ts); 0 of 20,000 bad afterwards. Owners who already have a bad stored key still need to rotate it once.

Split out of the release flake PR (#325), where the SSH installer test's own host key hit the same bug.

Copy audit: no UI text changed.

Fixes: #5

ssh2's ed25519 keygen drops a leading zero byte of the public key, one
key in 256, and writes a private key that neither ssh2 nor OpenSSH can
read (Malformed OpenSSH private key; 83 of 20000 generated keys). An
owner who got such a key had a truncated public key and an SSH install
that failed until the key was rotated. A pair that does not parse is now
generated again.

Fixes: #5
@nixuuu
nixuuu merged commit 8d548ce into dev Nov 7, 2026
9 checks passed
@nixuuu
nixuuu deleted the fix/ssh-install-key branch November 7, 2026 09:40
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.

1 participant