Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
PMASA-2020-1
diff --git a/libraries/server_privileges.lib.php b/libraries/server_privileges.lib.php
index 86c46ef6f7..1bf7b6e07b 100644
--- a/libraries/server_privileges.lib.php
+++ b/libraries/server_privileges.lib.php
@@ -2448,7 +2448,7 @@ function PMA_getExtraDataForAjaxBehavior(
if (isset($_REQUEST['validate_username'])) {
$sql_query = "SELECT * FROM `mysql`.`user` WHERE `User` = '"
- . $_REQUEST['username'] . "';";
+ . PMA_Util::sqlAddSlashes($_REQUEST['username']) . "';";
$res = $GLOBALS['dbi']->query($sql_query);
$row = $GLOBALS['dbi']->fetchRow($res);
if (empty($row)) {
diff --git a/libraries/server_privileges.lib.php b/libraries/server_privileges.lib.php
index 86c46ef6f7..1bf7b6e07b 100644
--- a/libraries/server_privileges.lib.php
+++ b/libraries/server_privileges.lib.php
@@ -2448,7 +2448,7 @@ function PMA_getExtraDataForAjaxBehavior(
if (isset($_REQUEST['validate_username'])) {
$sql_query = "SELECT * FROM `mysql`.`user` WHERE `User` = '"
- . $_REQUEST['username'] . "';";
+ . $GLOBALS['dbi']->escapeString($_REQUEST['username']) . "';";
$res = $GLOBALS['dbi']->query($sql_query);
$row = $GLOBALS['dbi']->fetchRow($res);
if (empty($row)) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.