MySQL user Privilege Bug if some external IP's are Free to connect...  [SOLVED]

Have you discovered a bug? Tell us about it.
Post Reply
marci
Posts: 26
Joined: Wed 19. Feb 2020, 09:06

MySQL user Privilege Bug if some external IP's are Free to connect...

Post by marci »

I'm sure the cause of the problem is within KeyHelp
YES

Server operating system + version
Debian 13


Server virtualization technology used
KVM


KeyHelp version + build number
26.0 (Build 3618)


Problem description / error messages
If you got a Database with special chars, which will be escaped by SQL AND several IP addresses which should connect to the database, this happens as example if you want to give "1.1.1.1" and "2.2.2.2" and "3.3.3.3" access to "Test_DB" with the user "Test_DBu".. it gives for every next ip one \ more what is wrong... so it just works for the first host...:

Code: Select all

MariaDB [(none)]> SHOW GRANTS FOR 'Test_DBu'@'1.1.1.1';
+----------------------------------------------------------------------------------------------------------------------------+
| Grants for Test_DBu@1.1.1.1                                                                                   |
+----------------------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO `Test_DBu`@`1.1.1.1` IDENTIFIED BY PASSWORD '*12345ABCD |
| GRANT ALL PRIVILEGES ON `Test\_DB`.* TO `Test_DBu`@`1.1.1.1`                                          |
+----------------------------------------------------------------------------------------------------------------------------+

MariaDB [(none)]> SHOW GRANTS FOR 'Test_DBu'@'2.2.2.2';
+----------------------------------------------------------------------------------------------------------------------------+
| Grants for Test_DBu@2.2.2.2                                                                                   |
+----------------------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO `Test_DBu`@`2.2.2.2` IDENTIFIED BY PASSWORD '*12345ABCD |
| GRANT ALL PRIVILEGES ON `Test\\_DB`.* TO `Test_DBu`@`2.2.2.2`                                          |
+----------------------------------------------------------------------------------------------------------------------------+

MariaDB [(none)]> SHOW GRANTS FOR 'Test_DBu'@'3.3.3.3';
+----------------------------------------------------------------------------------------------------------------------------+
| Grants for Test_DBu@3.3.3.3                                                                                   |
+----------------------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO `Test_DBu`@`3.3.3.3` IDENTIFIED BY PASSWORD '*12345ABCD |
| GRANT ALL PRIVILEGES ON `Test\\\_DB`.* TO `Test_DBu`@`3.3.3.3`                                          |
+----------------------------------------------------------------------------------------------------------------------------+


Expected result

Code: Select all

MariaDB [(none)]> SHOW GRANTS FOR 'Test_DBu'@'1.1.1.1';
+----------------------------------------------------------------------------------------------------------------------------+
| Grants for Test_DBu@1.1.1.1                                                                                   |
+----------------------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO `Test_DBu`@`1.1.1.1` IDENTIFIED BY PASSWORD '*12345ABCD |
| GRANT ALL PRIVILEGES ON `Test\_DB`.* TO `Test_DBu`@`1.1.1.1`                                          |
+----------------------------------------------------------------------------------------------------------------------------+

MariaDB [(none)]> SHOW GRANTS FOR 'Test_DBu'@'2.2.2.2';
+----------------------------------------------------------------------------------------------------------------------------+
| Grants for Test_DBu@2.2.2.2                                                                                   |
+----------------------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO `Test_DBu`@`2.2.2.2` IDENTIFIED BY PASSWORD '*12345ABCD |
| GRANT ALL PRIVILEGES ON `Test\_DB`.* TO `Test_DBu`@`2.2.2.2`                                          |
+----------------------------------------------------------------------------------------------------------------------------+

MariaDB [(none)]> SHOW GRANTS FOR 'Test_DBu'@'3.3.3.3';
+----------------------------------------------------------------------------------------------------------------------------+
| Grants for Test_DBu@3.3.3.3                                                                                   |
+----------------------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO `Test_DBu`@`3.3.3.3` IDENTIFIED BY PASSWORD '*12345ABCD |
| GRANT ALL PRIVILEGES ON `Test\_DB`.* TO `Test_DBu`@`3.3.3.3`                                          |
+----------------------------------------------------------------------------------------------------------------------------+


Actual result
only 1.1.1.1 can connect to MySQL....

Steps to reproduce
shown above :)


Additional information
not needed ;)


.
User avatar
Alexander
Keyweb AG
Posts: 4912
Joined: Wed 20. Jan 2016, 02:23

Re: MySQL user Privilege Bug if some external IP's are Free to connect...  [SOLVED]

Post by Alexander »

Hello,

Thank you very much for the report!

I will fix it within the upcoming KeyHelp 26.1.
Mit freundlichen Grüßen / Best regards
Alexander Mahr

**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
Post Reply