CVE-2020-29652: Golang.org/x/crypto Golang.org/x/crypto/ssh NULL Pointer Dereference Vulnerability Vulnerability

HIGH
Advisory Identifier: GHSA-3vm4-22fp-5rfm
CVSS 7.5
CWE-476
Published
Advisory Summary

CVE-2020-29652 is a HIGH (CVSS 7.5) golang.org/x/crypto/ssh null pointer dereference vulnerability vulnerability (CWE-476: NULL Pointer Dereference) affecting Golang.org/x/crypto libraries in the Go ecosystem. The issue involves golang.org/x/crypto/ssh null pointer dereference vulnerability. Remediation is available by upgrading affected packages to version 0.0.0-20201216223049-8b5274cf687f.

CVE-2020-29652 at a Glance

CVE Identifier CVE-2020-29652
GHSA Identifier GHSA-3vm4-22fp-5rfm
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-476: NULL Pointer Dereference
Affected Product Golang.org/x/crypto
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2020-29652

To remediate this vulnerability, upgrade all affected Golang.org/x/crypto dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

golang.org/x/crypto fixed: 0.0.0-20201216223049-8b5274cf687f
Upgrade golang.org/x/crypto to 0.0.0-20201216223049-8b5274cf687f
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for golang.org/x/crypto

How to Check if You Are Affected

To determine whether your application is affected by CVE-2020-29652, inspect your project dependencies for Golang.org/x/crypto:

inspect dependencies for golang.org/x/crypto

Analyze the terminal output to locate any version of Golang.org/x/crypto in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.0.0-20201216223049-8b5274cf687f), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-476: NULL Pointer Dereference, where the product dereferences a pointer that it expects to be valid but is null. In Golang.org/x/crypto, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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.

CVE-2020-29652 Affected Golang.org/x/crypto Versions

1 component(s)
Fixed Versions:
0.0.0-20201216223049-8b5274cf687f
Product / Package Ecosystem Affected Versions Fixed Version
golang.org/x/crypto
Go
< 0.0.0-20201216223049-8b5274cf687f
0.0.0-20201216223049-8b5274cf687f

References

Frequently Asked Questions

What is CVE-2020-29652?
CVE-2020-29652 is a security vulnerability in Golang.org/x/crypto involving golang.org/x/crypto/ssh NULL Pointer Dereference vulnerability under CWE-476: NULL Pointer Dereference.
Which Golang.org/x/crypto versions are affected?
Affected versions include releases prior to 0.0.0-20201216223049-8b5274cf687f across affected packages: golang.org/x/crypto.
What version fixes CVE-2020-29652?
Upgrading to 0.0.0-20201216223049-8b5274cf687f (or the latest patched release for your respective branch) resolves the vulnerability.
Is golang.org/x/crypto affected?
Yes, golang.org/x/crypto is affected in releases prior to 0.0.0-20201216223049-8b5274cf687f. Upgrade your dependency to 0.0.0-20201216223049-8b5274cf687f or later.
What is the CVSS score of CVE-2020-29652?
CVE-2020-29652 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2020-29652?
CVE-2020-29652 is classified under CWE-476: NULL Pointer Dereference (The product dereferences a pointer that it expects to be valid but is NULL.).
How can I check Go dependencies for CVE-2020-29652?
Run the dependency tree command: 'inspect dependencies for golang.org/x/crypto'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-3vm4-22fp-5rfm",
  "modified" : "2023-07-12T20:45:53Z",
  "published" : "2022-05-24T22:01:25Z",
  "aliases" : [ "CVE-2020-29652" ],
  "summary" : "golang.org/x/crypto/ssh NULL Pointer Dereference vulnerability",
  "details" : "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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "golang.org/x/crypto"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.0.0-20201216223049-8b5274cf687f"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-29652"
  }, {
    "type" : "WEB",
    "url" : "https://go-review.googlesource.com/c/crypto/+/278852"
  }, {
    "type" : "WEB",
    "url" : "https://go.dev/cl/278852"
  }, {
    "type" : "WEB",
    "url" : "https://go.googlesource.com/crypto/+/8b5274cf687fd9316b4108863654cc57385531e8"
  }, {
    "type" : "WEB",
    "url" : "https://groups.google.com/g/golang-announce/c/ouZIlBimOsE?pli=1"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r68032132c0399c29d6cdc7bd44918535da54060a10a12b1591328bff@%3Cnotifications.skywalking.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2021-0227"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-476" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-02-08T00:29:05Z",
    "nvd_published_at" : "2020-12-17T05:15:00Z"
  }
}