GHSA-f5wc-c3c7-36mc CVE-2026-39832 GO-2026-5006
golang.org/x/crypto doesn't drop invoking agent constraints when forwarding keys
- Severity
- 9.1 / 10
- Critical · CVSS 3.1
- Exploit chance (EPSS)
- 0.68%
- Chance of exploitation in the next 30 days. Higher than 52.55% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Fix
0.52.0- Upgrade golang.org/x/crypto to this version or later
Description
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.
Affected versions
Go
| Package | Vulnerable | Fixed in |
|---|---|---|
| golang.org/x/crypto | < 0.52.0 |
0.52.0 |
| golang.org/x/crypto | < 0.52.0 |
0.52.0 |
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
golang.org/x/crypto Go → 0.52.0
- go
go get golang.org/x/crypto@v0.52.0 && go mod tidy
Severity breakdown
CVSS 3.1 9.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- High
- Availability
- None
Weakness
CWE-281: Improper Preservation of Permissions
The product does not preserve permissions or incorrectly preserves permissions when copying, restoring, or sharing objects, which can cause them to have less restrictive permissions than intended.
CWE-502: Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid.
How to prevent it
- Architecture and Design, Implementation: If available, use the signing/sealing features of the programming language to assure that deserialized data has not been tainted. For example, a hash-based message authentication code (HMAC) could be used to ensure that data has not been modified.
- Implementation: When deserializing data, populate a new object rather than just deserializing. The result is that the data flows through safe input validation and that the functions are safe.
- Implementation: Explicitly define a final object() to prevent deserialization.
- Architecture and Design, Implementation: Make fields transient to protect them from deserialization. An attempt to serialize and then deserialize a class containing transient fields will result in NULLs where the transient data should be. This is an excellent way to prevent time, environment-based, or sensitive variables from being carried over and used improperly.
- Implementation: Avoid having unnecessary types or gadgets (a sequence of instances and method invocations that can self-execute during the deserialization process, often found in libraries) available that can be leveraged for malicious ends. This limits the potential for unintended or unauthorized types and gadgets to be leveraged by the attacker. Add only acceptable classes to an allowlist. Note: new gadgets are constantly being discovered, so this alone is not a sufficient mitigation.
- Architecture and Design, Implementation: Employ cryptography of the data or code for protection. However, it's important to note that it would still be client-side security. This is risky because if the client is compromised then the security implemented on the client (the cryptography) can be bypassed.
- Operation: Use an application firewall that can detect attacks against this weakness. It can be beneficial in cases in which the code cannot be fixed (because it is controlled by a third party), as an emergency prevention measure while more comprehensive software assurance measures are applied, or to provide defense in depth [REF-1481].
References
Advisories
Fixes and patches
Packages
Other links
- go.dev/cl/778642
- go.dev/issue/79435
- groups.google.com/g/golang-announce/c/a082jnz-LvI
- pkg.go.dev/vuln/GO-2026-5006
- access.redhat.com/security/cve/CVE-2026-39832
- bugzilla.redhat.com/show_bug.cgi
- security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-39832.json
- access.redhat.com/errata/RHSA-2026:35833
- access.redhat.com/errata/RHSA-2026:36199
- access.redhat.com/errata/RHSA-2026:36319
- access.redhat.com/errata/RHSA-2026:36625
- access.redhat.com/errata/RHSA-2026:36648
- access.redhat.com/errata/RHSA-2026:37271
- access.redhat.com/errata/RHSA-2026:37123
- access.redhat.com/errata/RHSA-2026:37072
- access.redhat.com/errata/RHSA-2026:36797
- access.redhat.com/errata/RHSA-2026:36796
- access.redhat.com/errata/RHSA-2026:36651
- access.redhat.com/errata/RHSA-2026:37410
- access.redhat.com/errata/RHSA-2026:37387
- access.redhat.com/errata/RHSA-2026:40262
- access.redhat.com/errata/RHSA-2026:40118
- access.redhat.com/errata/RHSA-2026:41066
- access.redhat.com/errata/RHSA-2026:41036
- access.redhat.com/errata/RHSA-2026:41031
- access.redhat.com/errata/RHSA-2026:41019
- access.redhat.com/errata/RHSA-2026:40972
- access.redhat.com/errata/RHSA-2026:40945
- access.redhat.com/errata/RHSA-2026:42146
- access.redhat.com/errata/RHSA-2026:42796
- access.redhat.com/errata/RHSA-2026:43052
- access.redhat.com/errata/RHSA-2026:43692
- access.redhat.com/errata/RHSA-2026:49944
- access.redhat.com/errata/RHSA-2026:52857
- access.redhat.com/errata/RHSA-2026:52910
- access.redhat.com/errata/RHSA-2026:57194
- access.redhat.com/errata/RHSA-2026:59579
- access.redhat.com/errata/RHSA-2026:61314
- access.redhat.com/errata/RHSA-2026:66521
- access.redhat.com/errata/RHSA-2026:67450
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GO-2026-6355 Prevent DoS on deadlocked established channel in golang.org/x/crypto/ssh | High | Also affects golang.org/x/crypto |
| GO-2026-6354 Prevent DoS on deadlocked undecided channel in golang.org/x/crypto/ssh | High | Also affects golang.org/x/crypto |
| GO-2026-6303 Source-address critical option not enforced for non-public-key auth callbacks in golang.org/x/crypto/ssh | High | Also affects golang.org/x/crypto |
| GO-2026-5932 The golang.org/x/crypto/openpgp package is unmaintained, unsafe by design, and has known security issues | Not rated yet | Also affects golang.org/x/crypto |
| GHSA-x527-x647-q7gg golang.org/x/crypto: Invoking VerifiedPublicKeyCallback permissions skip enforcement | Critical | Also affects golang.org/x/crypto |
| GHSA-w879-237q-wc7r golang.org/x/crypto: Invoking pathological RSA/DSA parameters may cause DoS | High | Also affects golang.org/x/crypto |
| GHSA-vgwf-h737-ff37 golang.org/x/crypto: Invoking client can cause server deadlock on unexpected responses | Critical | Also affects golang.org/x/crypto |
| GHSA-rm3j-f69w-wqmq golang.org/x/crypto vulnerable to infinite loop on large channel writes | Critical | Also affects golang.org/x/crypto |
Credits: NCC Group Cryptography Services, sponsored by Teleport
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor