Executive brief
The mysql Node.js driver, used to connect web applications and services to MySQL databases, had the LOAD DATA LOCAL INFILE option enabled by default. This feature allows MySQL to read files from the client machine, and an attacker with database access could exploit this to extract sensitive files (such as configuration files or private keys) from the application server.
Technical details
The vulnerability is an information disclosure issue (CWE-200) in the mysql module for Node.js version 2.17.1. The LOAD DATA LOCAL INFILE SQL statement was enabled by default, permitting a malicious database server (or an attacker with database access) to read arbitrary files from the client system. An attacker with network access to the MySQL connection and the ability to interact with the database can trigger file reads. The vulnerability was patched in version 2.18.0 by disabling this option by default; applications requiring this functionality must now explicitly enable it.
Affected products
- mysqljs mysql 2.17.1 through 2.17.x (fixed in 2.18.0)
Timeline
- 2019-08-12: disclosed
- 2022-05-24: advisory: GitHub Security Advisory GHSA-f982-mxwc-3mrx published
- 2018: patched: Fixed in version 2.18.0 (commit 337e87a)