CVE-2022-31011: Github.com/pingcap/tidb Authentication Bypass Vulnerability

HIGH
Advisory Identifier: GHSA-4whx-7p29-mq22
CVSS 7.8
CWE-287
Published
Advisory Summary

CVE-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.

CVE-2022-31011 at a Glance

CVE Identifier CVE-2022-31011
GHSA Identifier GHSA-4whx-7p29-mq22
Severity HIGH
CVSS v3.1 Base Score 7.8
CWE Classification CWE-287: Improper Authentication
Affected Product Github.com/pingcap/tidb
Package Ecosystem Go
Published Date
Last Updated

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).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (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.

github.com/pingcap/tidb fixed: 5.3.1
Upgrade github.com/pingcap/tidb to 5.3.1
github.com/pingcap/tidb fixed: 0.0.0-20220221072141-27ffd1126da1
Upgrade github.com/pingcap/tidb to 0.0.0-20220221072141-27ffd1126da1
github.com/pingcap/tidb fixed: 1.1.0-beta.0.20220221072141-27ffd1126da1
Upgrade github.com/pingcap/tidb to 1.1.0-beta.0.20220221072141-27ffd1126da1
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-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

### Impact Under certain conditions, an attacker can construct malicious authentication requests to bypass the authentication process, resulting in privilege escalation or unauthorized access. Only users using TiDB 5.3.0 are affected by this vulnerability. ### Patches Please upgrade to TiDB 5.3.1 or higher version ### Workarounds You can also mitigate risks by taking the following measures. Option 1: Turn off SEM (Security Enhanced Mode). Option 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. ### References https://en.pingcap.com/download/ ### For more information If you have any questions or comments about this advisory: * Email us at security@tidb.io

CVE-2022-31011 Affected Github.com/pingcap/tidb Versions

3 component(s)
Fixed Versions:
5.3.10.0.0-20220221072141-27ffd1126da11.1.0-beta.0.20220221072141-27ffd1126da1
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?
CVE-2022-31011 is a security vulnerability in Github.com/pingcap/tidb involving TiDB authentication bypass vulnerability under CWE-287: Improper Authentication.
Which Github.com/pingcap/tidb versions are affected?
Affected versions include releases prior to 5.3.1, 0.0.0-20220221072141-27ffd1126da1, 1.1.0-beta.0.20220221072141-27ffd1126da1 across affected packages: github.com/pingcap/tidb.
What version fixes CVE-2022-31011?
Upgrading to 5.3.1, 0.0.0-20220221072141-27ffd1126da1, 1.1.0-beta.0.20220221072141-27ffd1126da1 (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 5.3.1, 0.0.0-20220221072141-27ffd1126da1, 1.1.0-beta.0.20220221072141-27ffd1126da1. Upgrade your dependency to 5.3.1, 0.0.0-20220221072141-27ffd1126da1, 1.1.0-beta.0.20220221072141-27ffd1126da1 or later.
What is the CVSS score of CVE-2022-31011?
CVE-2022-31011 has a CVSS v3.1 base score of 7.8 (HIGH) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2022-31011?
CVE-2022-31011 is classified under CWE-287: Improper Authentication (When an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct.).
How can I check Go dependencies for CVE-2022-31011?
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-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"
  }
}