CVE-2021-2021 MySql Server 8.0.22 and prior is affected by a vulnerability.
High privileged attacker (such as root user) can exploit this vulnerability by connecting to MySQL via network and then executing malicious code. By default, MySQL is configured to accept client connections only from the local host (127.0.0.1).
If you wish to allow access from remote hosts, you have to modify the server configuration. For example, to enable remote access, you can change the default configuration directive for `MySQL` service to `On` and then `OK`. However, this approach has several disadvantages. The main drawback of this method is that it allows hackers to connect to the server as root user, which gives the attacker complete control over the server. The second disadvantage is that this setting will not work when the server is configured to use a different host (such as `localhost`) for the root user. To work around this problem, you will have to change the host where the MySQL server is running. The last method for allowing remote access to the MySQL server is to use a network address where the server is accessible. For example, if the server is running on `192.168.1.100`, then you can configure MySQL server as follows: Syntax: `[mysqld] -u root -H `mysqld_safe` --bind-address=192.168.1.100
In the first line, `192.168.1.100` is the network address where the MySQL server is accessible. After that,
MySQL Server Configuration Option
The MySQL configuration file is located in `/etc/mysql/my.cnf`. If you modify this file, you have to restart the server so that the changes take effect.
Timeline
Published on: 01/20/2021 15:15:00 UTC
Last modified on: 01/04/2022 17:27:00 UTC
References
- https://www.oracle.com/security-alerts/cpujan2021.html
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/CS5THZSGI7O2CZO44NWYE57AG2T7NK3K/
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/T7EAHJPWOOF4D6PEFLXW5IQWRRSZ3HRC/
- https://security.netapp.com/advisory/ntap-20210219-0003/
- https://security.gentoo.org/glsa/202105-27
- https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2021-2021