Repository navigation
fix(gateway): never store an unreadable ssh install key - #326
Merged
Merged
Conversation
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
This was referenced Nov 13, 2026
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.
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