VYPR
High severityNVD Advisory· Published Mar 18, 2022· Updated Aug 3, 2024

CVE-2022-27191

CVE-2022-27191

Description

The golang.org/x/crypto/ssh package before 0.0.0-20220314234659-1baeb1ce4c0b for Go allows an attacker to crash a server in certain circumstances involving AddHostKey.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

The golang.org/x/crypto/ssh package before commit 1baeb1ce4c0b allows a denial of service via server crash when a custom RSA Signer without AlgorithmSigner support is used as a host key.

Vulnerability

The vulnerability resides in the golang.org/x/crypto/ssh package, specifically in the server-side host key negotiation logic. When a server is configured by passing a Signer to ServerConfig.AddHostKey, and that Signer does not implement the AlgorithmSigner interface but returns a key of type "ssh-rsa" from its PublicKey method, the server incorrectly advertises rsa-sha2 signature algorithms. During key exchange, the server then fails to find a suitable host key to produce the required signature, causing a crash. This affects all versions before commit 1baeb1ce4c0b (version v0.0.0-20220314234659-1baeb1ce4c0b). Servers that only use Signer implementations provided by the ssh package are unaffected [1][3][4].

Exploitation

An attacker with network access to the vulnerable SSH server can trigger the crash by initiating an SSH connection. The crash occurs during the host key algorithm negotiation phase, before any authentication is required. No prior authentication or special privileges are needed; the attacker simply needs to establish a TCP connection and begin the SSH handshake. The server will then attempt to negotiate host key algorithms, encounter the mismatch, and crash [3][4].

Impact

Successful exploitation results in a denial of service (DoS) condition: the SSH server process crashes, terminating all active connections and rendering the service unavailable until restarted. There is no evidence of data compromise, privilege escalation, or remote code execution; the impact is limited to availability [1][3].

Mitigation

The fix is included in commit 1baeb1ce4c0b (version v0.0.0-20220314234659-1baeb1ce4c0b) of golang.org/x/crypto/ssh. Users should update to this version or later. As a workaround, ensure that any custom Signer passed to AddHostKey implements the AlgorithmSigner interface, or use only Signer implementations provided by the ssh package. No workaround is needed for servers using only built-in signers [3][4].

AI Insight generated on May 21, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
golang.org/x/cryptoGo
< 0.0.0-20220314234659-1baeb1ce4c0b0.0.0-20220314234659-1baeb1ce4c0b

Affected products

246

Patches

0

No patches discovered yet.

Vulnerability mechanics

AI mechanics synthesis has not run for this CVE yet.

References

33

News mentions

0

No linked articles in our index yet.