Client, not client!
The application allowed users to supply database connection parameters for a MySQL client, and the client executed a LOAD DATA LOCAL INFILE statement that read a local file from the server and sent it to the attacker's MySQL server. An attacker could read arbitrary files accessible to the MySQL client process.
This blog describes one of my findings on a private program. The attack vector is simple, short and elegant (at least for me).
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the MySQL client allowed the LOAD DATA LOCAL INFILE feature, which lets a malicious server instruct the client to read local files and send them to the server.
What the attacker needed
A test account; ability to set database connection parameters; attacker-controlled MySQL server
How it was found
- Create a test account and fill in the source info with database connection parameters.
- Set up a MySQL server with a user, database, and table, and open the port.
- In the SQL SELECT box, enter a LOAD DATA LOCAL INFILE statement targeting a local file.
- Send the request and receive the target file on the attacker's server.
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 write-up has not been written yet. The Original tab links to the source.
A MySQL client is a program that connects to a database. This application let users tell it which database to connect to, and the client followed instructions from that database to read a file on the server and send it back. That let the attacker steal files from the server.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.