Skip to content

Commit 43632f4

Browse files
author
Anushree Prakash B
committed
Bug#26372491 - RCE THROUGH THE MISHANDLE OF BACKSLASH
DESCRIPTION: =========== The bug is related to incorrect parsing of SQL queries when typed in on the CLI. The incorrect parsing can result in unexpected results. ANALYSIS: ======== The scenarios mainly happens for identifier names with a typical combination of backslashes and backticks. The incorrect parsing can either result in executing additional queries or can result in query truncation. This can impact mysqldump as well. FIX: === The fix makes sure that such identifier names are correctly parsed and a proper query is sent to the server for execution.
1 parent 14176f7 commit 43632f4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

client/mysql.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2119,7 +2119,10 @@ static bool add_line(String &buffer,char *line,char *in_string,
21192119
if (*in_string || inchar == 'N') // \N is short for NULL
21202120
{ // Don't allow commands in string
21212121
*out++='\\';
2122-
*out++= (char) inchar;
2122+
if ((inchar == '`') && (*in_string == inchar))
2123+
pos--;
2124+
else
2125+
*out++= (char) inchar;
21232126
continue;
21242127
}
21252128
if ((com=find_command(NullS,(char) inchar)))

0 commit comments

Comments
 (0)