mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-36380 User has unauthorized access to a sequence through a view with security invoker
check sequence privileges in Item_func_nextval::fix_fields(), just like column privileges are checked in Item_field::fix_fields() remove sequence specific hacks that kinda made sequence privilege checks works, but not in all cases. And they were too lax, didn't requre SELECT privilege for NEXTVAL. Also INSERT privilege looks wrong here, UPDATE would've been more appropriate, but won't change that for compatibility reasons. also fixes MDEV-36413 User without any privileges to a sequence can read from it and modify it via column default
This commit is contained in:
@@ -285,7 +285,7 @@ create sequence s_db.s2;
|
||||
drop sequence s_db.s2;
|
||||
connection m_normal_2;
|
||||
select NEXT VALUE for s_db.s1;
|
||||
ERROR 42000: INSERT command denied to user 'normal_2'@'localhost' for table `s_db`.`s1`
|
||||
ERROR 42000: SELECT, INSERT command denied to user 'normal_2'@'localhost' for table `s_db`.`s1`
|
||||
create sequence s_db.s2;
|
||||
ERROR 42000: CREATE command denied to user 'normal_2'@'localhost' for table `s_db`.`s2`
|
||||
connection m_normal_1;
|
||||
|
Reference in New Issue
Block a user