GHSA-3vm4-22fp-5rfm CVE-2020-29652 GO-2021-0227
golang.org/x/crypto/ssh NULL Pointer Dereference vulnerability
- Severity
- 7.5 / 10
- High · CVSS 3.1
- Exploit chance (EPSS)
- 3.18%
- Chance of exploitation in the next 30 days. Higher than 88.06% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-476 NULL Pointer Dereference
- Fix
0.0.0-20201216223049-8b5274cf687f- Upgrade golang.org/x/crypto to this version or later
Description
A nil pointer dereference in the golang.org/x/crypto/ssh component through v0.0.0-20201203163018-be400aefbc4c for Go allows remote attackers to cause a denial of service against SSH servers. An attacker can craft an authentication request message for the gssapi-with-mic method which will cause NewServerConn to panic via a nil pointer dereference if ServerConfig.GSSAPIWithMICConfig is nil.
Affected versions
Go
| Package | Vulnerable | Fixed in |
|---|---|---|
| golang.org/x/crypto | < 0.0.0-20201216223049-8b5274cf687f |
0.0.0-20201216223049-8b5274cf687f |
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.0.0-20201216223049-8b5274cf687f
- go
go get golang.org/x/crypto@v0.0.0-20201216223049-8b5274cf687f && go mod tidy
Severity breakdown
CVSS 3.1 7.5
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- None
- Integrity
- None
- Availability
- High
Weakness
CWE-476: NULL Pointer Dereference
The product dereferences a pointer that it expects to be valid but is NULL.
How to prevent it
- Implementation: For any pointers that could have been modified or provided from a function that can return NULL, check the pointer for NULL before use. When working with a multithreaded or otherwise asynchronous environment, ensure that proper locking APIs are used to lock before the check, and unlock when it has finished [REF-1484].
- Requirements: Select a programming language that is not susceptible to these issues.
- Implementation: Check the results of all functions that return a value and verify that the value is non-null before acting upon it.
- Architecture and Design: Identify all variables and data stores that receive information from external sources, and apply input validation to make sure that they are only initialized to expected values.
- Implementation: Explicitly initialize all variables and other data stores, either during declaration or just before the first usage.
References
Advisories
Other links
- go-review.googlesource.com/c/crypto/+/278852
- go.dev/cl/278852
- go.googlesource.com/crypto/+/8b5274cf687fd9316b4108863654cc57385531e8
- groups.google.com/g/golang-announce/c/ouZIlBimOsE
- lists.apache.org/thread.html/r68032132c0399c29d6cdc7bd44918535da54060a10a12b1591328bf…
- pkg.go.dev/vuln/GO-2021-0227
- lists.apache.org/thread.html/r68032132c0399c29d6cdc7bd44918535da54060a10a12b1591328bf…
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: Joern Schneewesiz (GitLab Security Research Team)
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