net-ssh - @revoked known_hosts entries are treated as valid pinned host keys — revoked host key accepted
Published: November 06, 2026
SECURITY IDENTIFIERS
- GHSA: GHSA-hjwv-j52r-xcg7
- Vendor Advisory: https://github.com/net-ssh/net-ssh/security/advisories/GHSA-hjwv-j52r-xcg7
GEM
SEVERITY
CVSS v3.x: 7.4 (High)
UNAFFECTED VERSIONS
< 6.3.0.beta1
PATCHED VERSIONS
~> 7.3.9
>= 8.1.1
DESCRIPTION
Net::SSH's known_hosts parser (Net::SSH::KnownHosts#keys_for) reads the OpenSSH @marker field but only special-cases @cert-authority. A line marked @revoked, which is the standard OpenSSH way to permanently retire a compromised host key, falls into the default branch and is loaded as a regular, trusted HostKeyEntries::PubKey pin. Every built-in host-key verifier (:always, :accept_new, and the default :accept_new_or_local_tunnel) then matches a server that presents exactly that revoked key and accepts it, even under the strictest verifier. A revoked key is one the operator already knows is compromised, and here it authenticates the host anyway. The revocation entry quietly turns into an authorization entry. OpenSSH's hostfile.c/check_host_key returns HOST_REVOKED for the same line and ssh(1) aborts with "Host key … was revoked", and ssh_config(5) says keys on a @revoked line "must always be refused".
Impact
Host authentication bypass that opens a full SSH MITM. The attacker can read and inject session plaintext (commands, output, uploaded data), capture credentials sent over password auth, and take over deploy-tool command channels, since Capistrano, Kamal, and sshkit all sit on net-ssh. A server the operator explicitly distrusted is accepted as the real host, so everything the user does over that connection is exposed.
