Arbitrary file reads via crafted database names
Published Nov 4, 2022 · Updated May 2, 2025
Data source name injection in the TiDB importer through 6.1.2 and 6.2.0 through 6.4.0-alpha1 allows local users to read arbitrary files. The createDB function in cmd/importer/db.go interpolates cfg.Name into a MySQL DSN, allowing DSN syntax in an untrusted name to alter driver behavior instead of remaining a database identifier. Exploitation requires a high-privileged user to run the importer with an attacker-controlled database name, and file access uses the importer's host permissions.
Summary
What happened
Data source name injection in the TiDB importer through 6.1.2 and 6.2.0 through 6.4.0-alpha1 allows local users to read arbitrary files. The createDB function in cmd/importer/db.go interpolates cfg.Name into a MySQL DSN, allowing DSN syntax in an untrusted name to alter driver behavior instead of remaining a database identifier. Exploitation requires a high-privileged user to run the importer with an attacker-controlled database name, and file access uses the importer's host permissions.
The record
- CVE
- CVE-2022-3023
- Published
- Nov 4, 2022
- Updated
- May 2, 2025
- Vendor
- PingCAP
- Product
- TiDB
- Classifications
- CWE-134, T1005
- Attack vector
- local
- Privileges
- admin
Timeline
How it unfolded
- Nov 4, 2022CVE publishedPublication date reported by the CVE source.
- May 2, 2025Record updatedLatest update available in the CVE record.
Exploitability
Present is not the same as exploitable
Compare your product and version with the public record. A matching version still requires validation against your environment.
Is a vulnerable build present?
Compare these published version ranges with your installed build and any vendor patches.
- Affected versionversion=unspecified <6.4.0, 6.1.3
What conditions does exploitation require?
What is affected?
Attacks
What attackers are doing with it
Daily unique IPs observed by Shadowserver honeypots for known exploited vulnerabilities (KEVs). Missing observations do not establish an absence of attacks.
Weakness, pattern, technique
Public exploit references
No public exploit references are available in this record.
Labels summarize the accepted research assessment. They do not indicate a test against your environment.
Technologies
Your stack
See the directory against your own environment.
Your stack
Check the software in your environment
Book a demo to see how Hinoki identifies affected software and validates exploitability in your environment.
Book a demo