TiDB vulnerable to Use of Externally-Controlled Format String
The TiDB importer CLI tool fails to sanitise the database name used when generating and inserting data, allowing data source name injection. An attacker could exploit this to read arbitrary files.
pingcap/tidb
Originally disclosed on huntr
TiDB server (importer CLI tool) prior to version 6.4.0 & 6.1.3 is vulnerable to data source name injection. The database name for generating and inserting data into a database does not properly sanitize user input which can lead to arbitrary file reads."
From the GitHub Advisory Database (GHSA-7fxj-fr3v-r9gj, CC BY 4.0).
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the importer constructs a data source name by concatenating an unsanitised database name, so special characters in the name alter the connection parameters.
Impact
An attacker could read arbitrary files accessible to the importer process.
What the attacker needed
Ability to supply a crafted database name to the importer
The fix
The issue was fixed in versions 6.4.0 and 6.1.3; the importer should sanitise or properly escape the database name before building the data source name.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
The importer tool builds a connection string (a data source name) using a database name that comes from user input. Because it does not clean that input, a crafted database name can change how the connection is made and make the tool read files it should not. This is called injection: untrusted input is treated as part of a command or configuration.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.