1
0
mirror of https://github.com/MariaDB/server.git synced 2025-05-29 21:42:28 +03:00
unknown 2124538d9c BUG#49124 Security issue with /*!-versioned */ SQL statements on Slave
/*![:version:] Query Code */, where [:version:] is a sequence of 5 
digits representing the mysql server version(e.g /*!50200 ... */),
is a special comment that the query in it can be executed on those 
servers whose versions are larger than the version appearing in the 
comment. It leads to a security issue when slave's version is larger 
than master's. A malicious user can improve his privileges on slaves. 
Because slave SQL thread is running with SUPER privileges, so it can
execute queries that he/she does not have privileges on master.

This bug is fixed with the logic below: 
- To replace '!' with ' ' in the magic comments which are not applied on
  master. So they become common comments and will not be applied on slave.

- Example:
  'INSERT INTO t1 VALUES (1) /*!10000, (2)*/ /*!99999 ,(3)*/
  will be binlogged as
  'INSERT INTO t1 VALUES (1) /*!10000, (2)*/ /* 99999 ,(3)*/

mysql-test/suite/rpl/t/rpl_conditional_comments.test:
  Test the patch for this bug.
sql/mysql_priv.h:
  Rename inBuf as rawBuf and remove the const limitation.
sql/sql_lex.cc:
  To replace '!' with ' ' in the magic comments which are not applied on
  master.
sql/sql_lex.h:
  Remove the const limitation on parameter buff, as it can be modified in the function since
  this patch.
  Add member function yyUnput for Lex_input_stream. It set a character back the query buff.
sql/sql_parse.cc:
  Rename inBuf as rawBuf and remove the const limitation.
sql/sql_partition.cc:
  Remove the const limitation on parameter part_buff, as it can be modified in the function since
  this patch.
sql/sql_partition.h:
  Remove the const limitation on parameter part_buff, as it can be modified in the function since
  this patch.
sql/table.h:
  Remove the const limitation on variable partition_info, as it can be modified since
  this patch.
2010-07-29 11:00:57 +08:00
..
2010-03-17 19:15:41 +01:00
2010-07-09 15:00:33 +02:00
2010-07-09 15:00:33 +02:00
2010-06-24 15:26:14 +04:00
2010-06-08 10:28:30 +04:00
2010-03-29 18:42:49 +05:00
2009-08-28 18:21:54 +02:00
2009-09-29 17:38:40 +02:00
2010-07-21 14:14:11 +04:00
2010-06-09 11:29:27 +03:00
2008-11-22 01:10:38 +01:00
2008-11-22 01:10:38 +01:00
2010-07-15 17:01:44 +04:00
2009-06-01 16:00:38 +04:00
2010-07-23 18:15:56 +07:00
2009-11-03 20:45:52 +03:00
2010-01-28 19:51:40 -02:00
2010-01-28 19:51:40 -02:00
2010-03-17 19:15:41 +01:00
2008-07-03 23:41:22 +04:00
2009-04-29 07:59:10 +05:00
2009-12-18 16:44:24 -02:00
2008-01-23 13:26:41 -07:00
2010-06-11 16:52:06 +04:00
2009-06-17 16:56:44 +02:00
2010-01-24 15:03:23 +08:00
2010-07-26 11:56:30 +02:00
2010-07-22 11:17:26 -05:00
2010-01-24 15:03:23 +08:00
2009-01-14 18:50:51 +04:00
2010-01-25 10:55:05 +08:00
2010-06-11 16:52:06 +04:00
2009-11-03 20:45:52 +03:00
2009-06-17 16:56:44 +02:00
2009-06-17 16:56:44 +02:00