Bug #83420 mysql_config_editor should validate parameters

Submitted: 18 Oct 2016 3:08 Modified: 18 Oct 2016 6:36
Reporter: Tsubasa Tanaka (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:5.7.15, 8.0.0 OS:CentOS (7.2)
Assigned to: CPU Architecture:Any

[18 Oct 2016 3:08] Tsubasa Tanaka
Description:
mysql_config_editor doesn't validate parameters except of parameter-name.

So, ~/.mylogin.cnf can have unexpected parameters when I include LF into parameter-value.

How to repeat:
$ mysql_config_editor reset
$ mysql_config_editor set --login-path=mysqld --socket="$(echo '/tmp/mysql.sock' ; echo 'skip-grant-tables')"
$ mysql_config_editor print --all
[mysqld]
socket = /tmp/mysql.sock
skip-grant-tables

skip-grant-tables was injected.

$ bin/mysqld_safe &
$ bin/mysql -uroot -S /tmp/mysql.sock
mysql> SHOW GRANTS;
ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement

Suggested fix:
Sanitize parameters in client/mysql_config_editor.cc:set_command
[18 Oct 2016 6:36] MySQL Verification Team
Hello Tanaka-San,

Thank you for the report.
Verified as described with 8.0 build.

Thanks,
Umesh

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.049 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.