Address restriction bypass in SSH authentication callbacks (GO-2026-6303)

SSH authentication callbacks in golang.org/x/crypto/ssh fail to enforce source-address restrictions

Description

Versions of golang.org/x/crypto before v0.55.0 do not check the source-address restriction in the Permissions returned by some SSH authentication callbacks. Address restrictions set by password, keyboard-interactive, no-authentication, or GSSAPI login callbacks may be ignored. The earlier fix for public-key authentication paths does not fully address this issue.

Potential impact

An attacker who meets the other requirements of the affected authentication path may log in from an address that should be denied. Services that do not use address restrictions do not meet this condition of the vulnerability.

Remediation

Update golang.org/x/crypto to v0.55.0 or later, then rebuild and deploy. Test connections from both allowed and denied addresses for each authentication callback used in production.

Examples

The following examples show a dependency declaration in go.mod.

Before

go
require golang.org/x/crypto v0.54.0

After

go
require golang.org/x/crypto v0.55.0

Update go.sum as well and check which module version the build actually selects. The version above is the minimum version that fixes this vulnerability.

References