golang.org/x/crypto/ssh/agent doesn't drop invoking agent constraints when forwarding keys
Date: 2026-06
Affected: go/golang.org/x/crypto/ssh/agent
Attack vector: other
Category: vulnerability-disclosure
Severity: Critical
CVE: CVE-2026-39832
CVE-2026-39833
CVE-2026-46598
CWE: CWE-129
CWE-281
CWE-502
CWE-862
CVSS: 9.1 (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N)

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.


Mitigations:

Architectural layers (MAESTRO):