mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
BUG#32111 - Security Breach via DATA/INDEX DIRECORY and RENAME TABLE
RENAME TABLE against a table with DATA/INDEX DIRECTORY overwrites the file to which the symlink points. This is security issue, because it is possible to create a table with some name in some non-system database and set DATA/INDEX DIRECTORY to mysql system database. Renaming this table to one of mysql system tables (e.g. user, host) would overwrite the system table. Return an error when the file to which the symlink points exist.
This commit is contained in:
@ -84,3 +84,9 @@ t1 CREATE TABLE `t1` (
|
||||
`b` int(11) default NULL
|
||||
) TYPE=MyISAM
|
||||
drop table t1;
|
||||
CREATE TABLE t1(a INT)
|
||||
DATA DIRECTORY='TEST_DIR/var/master-data/mysql'
|
||||
INDEX DIRECTORY='TEST_DIR/var/master-data/mysql';
|
||||
RENAME TABLE t1 TO user;
|
||||
Can't create/write to file 'TEST_DIR/var/master-data/mysql/user.MYI' (Errcode: 17)
|
||||
DROP TABLE t1;
|
||||
|
Reference in New Issue
Block a user