Vulnerabilities in pkg:golang/github.com/pingcap/tidb
PACKAGECVE-2022-31011 is a HIGH (CVSS 7.8) authentication bypass vulnerability (CWE-287: Improper Authentication) affecting Github.com/pingcap/tidb libraries in the Go ecosystem. The issue involves tidb authentication bypass vulnerability. Remediation is available by upgrading affected packages to version 5.3.1, 0.0.0-20220221072141-27ffd1126da1, 1.1.0-beta.0.20220221072141-27ffd1126da1.
pkg:golang/github.com/pingcap/tidb
Vulnerability advisories affecting package pkg:golang/github.com/pingcap/tidb. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-4whx-7p29-mq22 | CVE-2022-31011 | HIGH | TiDB authentication bypass vulnerability |
| GHSA-9g6g-xqv5-8g5w | CVE-2024-37820 | MODERATE | PingCAP TiDB nil pointer dereference |
| GHSA-7fxj-fr3v-r9gj | CVE-2022-3023 | CRITICAL | TiDB vulnerable to Use of Externally-Controlled Format String |
CVE-2022-31011 at a Glance
Security Impact
CVSS: 7.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2022-31011
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.
Upgrade github.com/pingcap/tidb to 5.3.1
Upgrade github.com/pingcap/tidb to 0.0.0-20220221072141-27ffd1126da1
Upgrade github.com/pingcap/tidb to 1.1.0-beta.0.20220221072141-27ffd1126da1
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-2022-31011, 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 5.3.1), 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-287: Improper Authentication, where when an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct. 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
CVE-2022-31011 Affected Github.com/pingcap/tidb Versions
3 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/pingcap/tidb
|
Go |
≥ 5.3.0
< 5.3.1
All 1 versions
5.3.0
|
5.3.1
|
|
github.com/pingcap/tidb
|
Go |
≥ 0.0.0-20210808221113-a7fdc2a05663
< 0.0.0-20220221072141-27ffd1126da1
|
0.0.0-20220221072141-27ffd1126da1
|
|
github.com/pingcap/tidb
|
Go |
≥ 1.1.0-beta.0.20210808221113-a7fdc2a05663
< 1.1.0-beta.0.20220221072141-27ffd1126da1
|
1.1.0-beta.0.20220221072141-27ffd1126da1
|
References
Frequently Asked Questions
What is CVE-2022-31011?
Which Github.com/pingcap/tidb versions are affected?
What version fixes CVE-2022-31011?
Is github.com/pingcap/tidb affected?
What is the CVSS score of CVE-2022-31011?
What CWE is associated with CVE-2022-31011?
How can I check Go dependencies for CVE-2022-31011?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-4whx-7p29-mq22",
"modified" : "2025-07-09T15:49:23Z",
"published" : "2022-06-06T21:22:28Z",
"aliases" : [ "CVE-2022-31011" ],
"summary" : "TiDB authentication bypass vulnerability",
"details" : "### Impact\nUnder certain conditions, an attacker can construct malicious authentication requests to bypass the authentication process, resulting in privilege escalation or unauthorized access.\nOnly users using TiDB 5.3.0 are affected by this vulnerability.\n\n### Patches\nPlease upgrade to TiDB 5.3.1 or higher version\n\n### Workarounds\nYou can also mitigate risks by taking the following measures.\nOption 1: Turn off SEM (Security Enhanced Mode).\nOption 2: Disable local login for non-root accounts and ensure that the same IP cannot be logged in as root or normal user at the same time.\n\n### References\nhttps://en.pingcap.com/download/\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Email us at security@tidb.io",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/pingcap/tidb"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "5.3.0"
}, {
"fixed" : "5.3.1"
} ]
} ],
"versions" : [ "5.3.0" ]
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/pingcap/tidb"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.0.0-20210808221113-a7fdc2a05663"
}, {
"fixed" : "0.0.0-20220221072141-27ffd1126da1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/pingcap/tidb"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.1.0-beta.0.20210808221113-a7fdc2a05663"
}, {
"fixed" : "1.1.0-beta.0.20220221072141-27ffd1126da1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/pingcap/tidb/security/advisories/GHSA-4whx-7p29-mq22"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-31011"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/pingcap/tidb"
}, {
"type" : "WEB",
"url" : "https://github.com/pingcap/tidb/releases/tag/v5.3.1"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-287" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-06-06T21:22:28Z",
"nvd_published_at" : "2022-05-31T20:15:00Z"
}
}