MySQL is a leading open-source relational database management system widely adopted by developers, system administrators, and enterprises for managing structured data. It powers everything from small websites to large-scale applications, offering robust performance and reliability. MySQL is often deployed on Linux servers, cloud instances, and containerized environments, making it a critical component in modern IT infrastructure.
The vulnerability involves the MySQL SHOW VARIABLES command, which can be exploited to enumerate system variables. This arises when the MySQL server is configured with weak access controls, allowing unauthenticated or low-privileged users to execute this command. The feature is intended for administrative diagnostics but becomes a security risk when exposed to unauthorized parties.
Technically, the scanner sends a SHOW VARIABLES query to the MySQL server on the default port 3306 or a custom port. If the server responds with a list of variables, it confirms that enumeration is possible. This includes sensitive data such as datadir, basedir, version, and plugin_dir, which can aid in further attacks like path traversal or privilege escalation.
If exploited, an attacker can gather critical configuration details, potentially leading to data breaches, unauthorized access, or system compromise. The exposure of system paths and version information can facilitate targeted attacks, making this a high-severity issue with a CVSS score of 8.0.
- Restrict execution of the SHOW VARIABLES command to only authenticated administrative users by revoking privileges from public roles.
- Implement network-level access controls, such as firewalls or security groups, to limit MySQL port (3306) access to trusted IP addresses only.
- Enable MySQL's built-in authentication mechanisms, including strong password policies and multi-factor authentication where possible.
- Regularly audit MySQL user permissions and remove any unnecessary or overly permissive grants.
- Use MySQL Enterprise Audit or third-party tools to monitor and log all SHOW VARIABLES attempts for suspicious activity.
- Apply the principle of least privilege by creating dedicated user roles with minimal required permissions for specific tasks.
- Keep MySQL updated to the latest stable version to benefit from security patches and improved access controls.
- Consider disabling the SHOW VARIABLES command entirely in production environments if not needed, using the --skip-show-database option or similar configurations.
Get AI-powered remediation steps tailored to your asset.
Try AI Solutions →