When adding a key to a remote agent constraint extensions such as restrict-destination-v00@openssh.com were not serialized in the request. Destination restrictions were silently stripped when forwarding keys, allowing unrestricted use of the key on the remote host. The client now serializes all constraint extensions. Additionally, the in-memory keyring returned by NewKeyring() now rejects keys with unsupported constraint extensions instead of silently ignoring them.
When a key was added to a remote SSH agent with constraint extensions, the library did not include these extensions in the serialized request. This resulted in constraint extensions being silently stripped during key forwarding operations. The remote agent treated the forwarded key as unrestricted, ignoring the client's access control intentions. The vulnerability stems from improper handling of deserialization and serialization of constraint extensions (CWE-502).
An attacker or unauthorized process with access to a remote SSH agent can use the forwarded key without any restrictions on the destination, violating access control policies and enabling unauthorized authentication and potential modification of resources on remote hosts.
Patches available from the vendor should be applied according to references (https://go.dev/cl/778642, https://pkg.go.dev/vuln/GO-2026-5006). After updating, the library correctly serializes all constraint extensions, and the in-memory keyring returned by NewKeyring() rejects keys with unsupported extensions instead of silently ignoring them.
Golang Crypto library (golang.org/x/crypto) — versions indicated in vendor references; affects applications using key forwarding to remote SSH agents and the NewKeyring() function.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:NGolang Crypto
APPGolang< 0.52.0
Related vulnerabilities
Golang Crypto: brak wymuszenia ograniczenia ConfirmBeforeUse w NewKeyring()
Integer overflow w Golang Crypto SSH — nieskończona pętla przy zapisie >4GB
Brak weryfikacji flagi User Presence w FIDO/U2F w Golang Crypto
Golang Crypto: resource leak przez niezamawiane odpowiedzi SSH global request
Nieprawidłowa weryfikacja unieważnionych kluczy CA w Golang Crypto