Skip to content

[Go 1.23.0, sustaining-v0.41.0] CVE-2025-47913: ssh/agent: return an error for unexpected message types#8

Open
Atharva-Shinde wants to merge 1 commit into
openshift-sustaining:sustaining-v0.41.0from
Atharva-Shinde:sustaining-v0.41.0
Open

[Go 1.23.0, sustaining-v0.41.0] CVE-2025-47913: ssh/agent: return an error for unexpected message types#8
Atharva-Shinde wants to merge 1 commit into
openshift-sustaining:sustaining-v0.41.0from
Atharva-Shinde:sustaining-v0.41.0

Conversation

@Atharva-Shinde

@Atharva-Shinde Atharva-Shinde commented Jul 24, 2026

Copy link
Copy Markdown

Process

git switch -c sustaining-v0.41.0 tags/v0.41.0
git am /tmp/fork-maintainer/GO-2025-4116/v0.41.0-GO-2025-4116-0.patch

Conflicts

No conflicts — patch applied cleanly.

Patch Source

https://go-review.googlesource.com/changes/crypto~700295/revisions/3/patch?download&raw

v0.41.0-GO-2025-4116-0.patch

Verification

Unit tests output
crypto git:(sustaining-v0.41.0) go test ./...
?       golang.org/x/crypto/acme/autocert/internal/acmetest     [no test files]
?       golang.org/x/crypto/acme/internal/acmeprobe     [no test files]
?       golang.org/x/crypto/cryptobyte/asn1     [no test files]
?       golang.org/x/crypto/internal/testenv    [no test files]
?       golang.org/x/crypto/internal/wycheproof/internal/dsa    [no test files]
?       golang.org/x/crypto/openpgp/errors      [no test files]
ok      golang.org/x/crypto/acme        9.651s
ok      golang.org/x/crypto/acme/autocert       1.293s
ok      golang.org/x/crypto/argon2      4.420s
ok      golang.org/x/crypto/bcrypt      3.302s
ok      golang.org/x/crypto/blake2b     1.490s
ok      golang.org/x/crypto/blake2s     2.803s
ok      golang.org/x/crypto/blowfish    3.090s
ok      golang.org/x/crypto/bn256       3.606s
ok      golang.org/x/crypto/cast5       2.993s
ok      golang.org/x/crypto/chacha20    3.954s
ok      golang.org/x/crypto/chacha20poly1305    4.854s
ok      golang.org/x/crypto/cryptobyte  5.250s
ok      golang.org/x/crypto/curve25519  5.640s
ok      golang.org/x/crypto/ed25519     6.034s
ok      golang.org/x/crypto/hkdf        5.231s
ok      golang.org/x/crypto/internal/alias      5.531s
ok      golang.org/x/crypto/internal/poly1305   7.366s
?       golang.org/x/crypto/poly1305    [no test files]
ok      golang.org/x/crypto/internal/wycheproof 8.658s
ok      golang.org/x/crypto/md4 7.006s
ok      golang.org/x/crypto/nacl/auth   7.020s
ok      golang.org/x/crypto/nacl/box    6.524s
ok      golang.org/x/crypto/nacl/secretbox      6.158s
ok      golang.org/x/crypto/nacl/sign   5.737s
ok      golang.org/x/crypto/ocsp        5.684s
ok      golang.org/x/crypto/openpgp     7.107s
ok      golang.org/x/crypto/openpgp/armor       5.700s
?       golang.org/x/crypto/ssh/terminal        [no test files]
ok      golang.org/x/crypto/openpgp/clearsign   14.500s
ok      golang.org/x/crypto/openpgp/elgamal     5.647s
ok      golang.org/x/crypto/openpgp/packet      5.516s
ok      golang.org/x/crypto/openpgp/s2k 4.872s
ok      golang.org/x/crypto/otr 3.355s
ok      golang.org/x/crypto/pbkdf2      3.729s
ok      golang.org/x/crypto/pkcs12      4.612s
ok      golang.org/x/crypto/pkcs12/internal/rc2 4.137s
ok      golang.org/x/crypto/ripemd160   4.936s
ok      golang.org/x/crypto/salsa20     5.327s
ok      golang.org/x/crypto/salsa20/salsa       8.123s
ok      golang.org/x/crypto/scrypt      7.465s
ok      golang.org/x/crypto/sha3        8.854s
ok      golang.org/x/crypto/ssh 8.662s
ok      golang.org/x/crypto/ssh/agent   6.779s
ok      golang.org/x/crypto/ssh/internal/bcrypt_pbkdf   5.644s
ok      golang.org/x/crypto/ssh/knownhosts      6.723s
ok      golang.org/x/crypto/ssh/test    11.574s
ok      golang.org/x/crypto/tea 6.736s
ok      golang.org/x/crypto/twofish     6.623s
ok      golang.org/x/crypto/x509roots/nss       6.507s
ok      golang.org/x/crypto/xtea        5.740s
ok      golang.org/x/crypto/xts 6.436s

Tag

v0.41.0-sec.1

Previously, receiving an unexpected message type in response to a key
listing or a signing request could cause a panic due to a failed type
assertion.

This change adds a default case to the type switch in order to detect
and explicitly handle unknown or invalid message types, returning a
descriptive error instead of crashing.

Fixes golang/go#75178

Change-Id: Icbc3432adc79fe3c56b1ff23c6724d7a6f710f3a
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/700295
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Jakub Ciolek <jakub@ciolek.dev>
@Atharva-Shinde Atharva-Shinde changed the title [Go 1.23.0] sustaining-v0.41.0 CVE-2025-47913: ssh/agent: return an error for unexpected message types [Go 1.23.0, sustaining-v0.41.0] CVE-2025-47913: ssh/agent: return an error for unexpected message types Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants