CVE-2024-37820: PingCAP TiDB nil pointer dereference
5.4
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.4069%
CWE
Published
6/25/2024
Updated
11/27/2024
KEV Status
No
Technology
Go
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:L
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| github.com/pingcap/tidb | go | < 8.2.0 | 8.2.0 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The key vulnerability stems from the ColumnSubstituteImpl function's handling of NewFunctionInternal calls. The original code (vulnerable version) directly returned NewFunctionInternal without error checking. The patch replaces this with NewFunction with error handling, indicating that the nil return from failed function creation was the root cause. The stack trace shows the panic occurs in inferCollation() when processing expressions substituted by this function. The commit specifically addresses this code path by adding error propagation to prevent nil values from being used in subsequent operations.