CVE-2024-37820: Github.com/pingcap/tidb PingCAP TiDB Nil Pointer Dereference Vulnerability

MODERATE
Advisory Identifier: GHSA-9g6g-xqv5-8g5w
CVSS 5.4
CWE-476
Published
Advisory Summary

CVE-2024-37820 is a MODERATE (CVSS 5.4) pingcap tidb nil pointer dereference vulnerability (CWE-476: NULL Pointer Dereference) affecting Github.com/pingcap/tidb libraries in the Go ecosystem. The issue involves pingcap tidb nil pointer dereference. Remediation is available by upgrading affected packages to version 8.2.0.

CVE-2024-37820 at a Glance

CVE Identifier CVE-2024-37820
GHSA Identifier GHSA-9g6g-xqv5-8g5w
Severity MODERATE
CVSS v3.1 Base Score 5.4
CWE Classification CWE-476: NULL Pointer Dereference
Affected Product Github.com/pingcap/tidb
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 5.4

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

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

How to Fix CVE-2024-37820

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

github.com/pingcap/tidb fixed: 8.2.0
Upgrade github.com/pingcap/tidb to 8.2.0
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 github.com/pingcap/tidb

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-37820, inspect your project dependencies for Github.com/pingcap/tidb:

inspect dependencies for github.com/pingcap/tidb

Analyze the terminal output to locate any version of Github.com/pingcap/tidb in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 8.2.0), 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 Github.com/pingcap/tidb, 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 PingCAP TiDB v8.2.0-alpha-216-gfe5858b allows attackers to crash the application via expression.inferCollation.

CVE-2024-37820 Affected Github.com/pingcap/tidb Versions

1 component(s)
Fixed Versions:
8.2.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/pingcap/tidb
Go
< 8.2.0
8.2.0

References

Frequently Asked Questions

What is CVE-2024-37820?
CVE-2024-37820 is a security vulnerability in Github.com/pingcap/tidb involving PingCAP TiDB nil pointer dereference under CWE-476: NULL Pointer Dereference.
Which Github.com/pingcap/tidb versions are affected?
Affected versions include releases prior to 8.2.0 across affected packages: github.com/pingcap/tidb.
What version fixes CVE-2024-37820?
Upgrading to 8.2.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/pingcap/tidb affected?
Yes, github.com/pingcap/tidb is affected in releases prior to 8.2.0. Upgrade your dependency to 8.2.0 or later.
What is the CVSS score of CVE-2024-37820?
CVE-2024-37820 has a CVSS v3.1 base score of 5.4 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:L.
What CWE is associated with CVE-2024-37820?
CVE-2024-37820 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-2024-37820?
Run the dependency tree command: 'inspect dependencies for github.com/pingcap/tidb'. 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-9g6g-xqv5-8g5w",
  "modified" : "2024-11-27T21:55:55Z",
  "published" : "2024-06-25T21:31:15Z",
  "aliases" : [ "CVE-2024-37820" ],
  "summary" : "PingCAP TiDB nil pointer dereference",
  "details" : "A nil pointer dereference in PingCAP TiDB v8.2.0-alpha-216-gfe5858b allows attackers to crash the application via expression.inferCollation.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:L"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/pingcap/tidb"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "8.2.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-37820"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pingcap/tidb/issues/53580"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pingcap/tidb/commit/3d68bd21240c610c6307713e2bd54a5e71c32608"
  }, {
    "type" : "WEB",
    "url" : "https://gist.github.com/ycybfhb/a9c1e14ce281f2f553adca84d384b761"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-9g6g-xqv5-8g5w"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/pingcap/tidb"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-476" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-11-21T23:19:51Z",
    "nvd_published_at" : "2024-06-25T19:15:11Z"
  }
}