Repository navigation
fix(ci): only trust Launchpad's pinned RSA host key - #115
Merged
Merged
Conversation
The cron job pins git.launchpad.net's host key by running ssh-keyscan and checking that the expected RSA fingerprint from https://help.launchpad.net/SSHFingerprints is among the results. Without -t, ssh-keyscan writes every key type the server offers to known_hosts. The check only looks at the RSA line, so any ECDSA or Ed25519 key in the scan is trusted without being verified. An attacker who can intercept the runner's connection can return the real RSA public key next to their own Ed25519 key. ssh-keyscan records host keys before it checks the server's signature, so this does not need Launchpad's private key. The fingerprint check passes, and `git push launchpad` then prefers the Ed25519 entry from known_hosts and connects to the attacker using the LAUNCHPAD_RSA key. Launchpad only serves the RSA key, so request just that type with `ssh-keyscan -t rsa`. known_hosts then contains only the key that the check verifies, and ssh rejects a server that offers any other key with "Host key verification failed". Fixes: nodejs#114 Signed-off-by: NopeCharon <[email protected]>
rvagg
approved these changes
Nov 16, 2026
rvagg
left a comment
Member
There was a problem hiding this comment.
ok .. not exactly a plausible attack vector but this isn't unreasonable
rvagg
pushed a commit
that referenced
this pull request
Nov 16, 2026
Fixes: #114 Signed-off-by: NopeCharon <[email protected]>
rvagg
pushed a commit
that referenced
this pull request
Nov 16, 2026
Fixes: #114 Signed-off-by: NopeCharon <[email protected]>
rvagg
pushed a commit
that referenced
this pull request
Nov 16, 2026
Fixes: #114 Signed-off-by: NopeCharon <[email protected]>
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.
Fixes #114
The cron job pins Launchpad's SSH host key by checking that the RSA fingerprint from https://help.launchpad.net/SSHFingerprints is among the
ssh-keyscanresults. Without-t,ssh-keyscanadds every key type the server offers toknown_hosts, and the check only verifies the RSA one. If someone intercepts the connection, they can return the real RSA public key alongside their own Ed25519 key. The check passes andgit push launchpadthen accepts the unverified Ed25519 key.Launchpad only serves the RSA key, so this change requests only that type with
ssh-keyscan -t rsa.known_hoststhen contains only the key the check verifies.Testing
sshdthat only has an Ed25519 key, impersonatinggit.launchpad.net:fingerprint check: PASSED, andsshaccepts the host key (Permission denied (publickey,password).).-t rsa: the fingerprint check fails. Ifknown_hostsholds only the real RSA key,sshreportsHost key verification failed.ssh-keyscan/ssh-keygenlines from the workflow in a clean container against the realgit.launchpad.net. The check passes, andssh [email protected]accepts the host key and reaches authentication (Permission denied (publickey).).actionlint .github/workflows/cron.ymlpasses.