You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cron trusts unverified Launchpad SSH host keys of other types #114
ssh-keyscan without -t asks for every key type, so it writes every key the server offers (RSA, ECDSA, Ed25519) to known_hosts. The grep only checks that the expected RSA line is one of them. The other lines are trusted without any check.
Someone who can intercept the runner's connection to git.launchpad.net 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 the attacker doesn't need Launchpad's private key for this. The fingerprint check passes. Then, during git push launchpad, OpenSSH prefers the key types already in known_hosts and accepts the attacker's Ed25519 key. The push, and the authenticated session using LAUNCHPAD_RSA, go to the attacker. Launchpad builds and publishes whatever is on those branches.
I reproduced this in an Ubuntu 24.04 container. I ran an sshd that only has an Ed25519 key and built known_hosts from its key plus the real RSA line:
Activity
fix(ci): only trust Launchpad's pinned RSA host key (#115)
fix(ci): only trust Launchpad's pinned RSA host key (#115)
fix(ci): only trust Launchpad's pinned RSA host key (#115)