# CVE-2022-31011: TiDB authentication bypass vulnerability

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.38% (percentile 24, 2026-11-26)
- **CWE:** CWE-287
- **Aliases:** GHSA-4whx-7p29-mq22
- **Published:** 2022-05-31T19:30:18.000Z
- **Modified:** 2026-06-17T04:44:36.047Z

## Who should check

- Projects that depend on Go package github.com/pingcap/tidb (\>= 5.3.0, \< 5.3.1)
- Anyone running pingcap tidb = 5.3.0

## Description

TiDB is an open-source NewSQL database that supports Hybrid Transactional and Analytical Processing (HTAP) workloads. 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. TiDB version 5.3.1 contains a patch for this issue. Other mitigation strategies include turning off Security Enhanced Mode (SEM), disabling local login for non-root accounts, and ensuring that the same IP cannot be logged in as root and normal user at the same time.

## Affected and fixed versions

- Go `github.com/pingcap/tidb`: affected \>= 5.3.0, \< 5.3.1; fixed 5.3.1, 0.0.0-20220221072141-27ffd1126da1, 1.1.0-beta.0.20220221072141-27ffd1126da1 (osv)
- pingcap tidb: = 5.3.0 (cvelist)

## Mitigation

- Upgrade github.com/pingcap/tidb to one of 5.3.1, 0.0.0-20220221072141-27ffd1126da1, 1.1.0-beta.0.20220221072141-27ffd1126da1 (or later in the same release line).

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2022-31011. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2022-31011.md
Affected: github.com/pingcap/tidb >= 5.3.0, < 5.3.1
Fixed in: 5.3.1, 0.0.0-20220221072141-27ffd1126da1, 1.1.0-beta.0.20220221072141-27ffd1126da1

Steps:
1. Search this machine and project for github.com/pingcap/tidb (Go), pingcap tidb: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2022-31011 being exploited?

There is no confirmed exploitation: CVE-2022-31011 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.38% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2022-31011?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2022-31011?

github.com/pingcap/tidb \>= 5.3.0, \< 5.3.1.

### Is there a fix for CVE-2022-31011?

Yes. Fixed in 5.3.1, 0.0.0-20220221072141-27ffd1126da1, 1.1.0-beta.0.20220221072141-27ffd1126da1. Upgrade github.com/pingcap/tidb to one of 5.3.1, 0.0.0-20220221072141-27ffd1126da1, 1.1.0-beta.0.20220221072141-27ffd1126da1 (or later in the same release line).

### How do I check if I'm affected by CVE-2022-31011?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/pingcap/tidb/security/advisories/GHSA-4whx-7p29-mq22>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2022-31011>
- other: <https://github.com/pingcap/tidb/releases/tag/v5.3.1>
- other: <https://github.com/pingcap/tidb>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2022-31011>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-4whx-7p29-mq22> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2022-31011> · JSON: <https://flawdb.com/api/v1/entries/CVE-2022-31011>
