CVE-2006-3676
CVSS5.1
发布时间 :2006-07-24 08:19:00
修订时间 :2008-09-05 17:07:46
NMCOPS    

[原文]admin/gallery_admin.php in planetGallery before 14.07.2006 allows remote attackers to execute arbitrary PHP code by uploading files with a double extension and directly accessing the file in the images directory, which bypasses a regular expression check for safe file types.


[CNNVD]PlanetGallery 'gallery_admin.php'任意文件上传漏洞(CNNVD-200607-383)

        PlanetGallery是一个商业PHP脚本,用于发布图库、显示图片描述等。
        PlanetGallery在匹配上传文件的名字时存在漏洞,远程攻击者可能利用此漏洞上传可执行的脚本文件从而在服务器上执行任意命令。
        PlanetGallery的admin/gallery_admin.php文件中存在错误的正则表达式:
        193 $allow_file_types = 'gif|jpg|jpeg|png|bmp';
        [...]
        197 if (preg_match('#\.'.$allow_file_types.'?#i',
         $_FILES['grafik']['name'][$i])) {
        [...]
        每个$_FILES['grafik']['name'][$i]变量都包含有上传文件的文件名。仅带有$allow_file_types中所提供的文件名扩展的图形是允许的,但正则表达式还匹配了类似于example.png.php的文件,Webserver将这类文件解释为PHP脚本。这就允许攻击者上传并执行任意PHP脚本。
        
        

- CVSS (基础分值)

CVSS分值: 5.1 [中等(MEDIUM)]
机密性影响: PARTIAL [很可能造成信息泄露]
完整性影响: PARTIAL [可能会导致系统文件被修改]
可用性影响: PARTIAL [可能会导致性能下降或中断资源访问]
攻击复杂度: HIGH [漏洞利用存在特定的访问条件]
攻击向量: [--]
身份认证: NONE [漏洞利用无需身份认证]

- CPE (受影响的平台与产品)

产品及版本信息(CPE)暂不可用

- OVAL (用于检测的技术细节)

未找到相关OVAL定义

- 官方数据库链接

http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2006-3676
(官方数据源) MITRE
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2006-3676
(官方数据源) NVD
http://www.cnnvd.org.cn/vulnerability/show/cv_cnnvdid/CNNVD-200607-383
(官方数据源) CNNVD

- 其它链接及资源

http://www.securityfocus.com/bid/19091
(PATCH)  BID  19091
http://secunia.com/advisories/21099
(VENDOR_ADVISORY)  SECUNIA  21099
http://xforce.iss.net/xforce/xfdb/27858
(UNKNOWN)  XF  planetgallery-galleryadmin-file-upload(27858)
http://www.securityfocus.com/archive/1/archive/1/440643/100/0/threaded
(VENDOR_ADVISORY)  BUGTRAQ  20060720 Advisory: Remote command execution in planetGallery
http://www.redteam-pentesting.de/advisories/rt-sa-2006-006.txt
(VENDOR_ADVISORY)  MISC  http://www.redteam-pentesting.de/advisories/rt-sa-2006-006.txt
http://www.osvdb.org/27417
(UNKNOWN)  OSVDB  27417
http://securityreason.com/securityalert/1268
(UNKNOWN)  SREASON  1268
http://archives.neohapsis.com/archives/fulldisclosure/2006-07/0434.html
(UNKNOWN)  FULLDISC  20060720 Advisory: Remote command execution in planetGallery

- 漏洞信息

PlanetGallery 'gallery_admin.php'任意文件上传漏洞
中危 输入验证
2006-07-24 00:00:00 2006-08-07 00:00:00
远程  
        PlanetGallery是一个商业PHP脚本,用于发布图库、显示图片描述等。
        PlanetGallery在匹配上传文件的名字时存在漏洞,远程攻击者可能利用此漏洞上传可执行的脚本文件从而在服务器上执行任意命令。
        PlanetGallery的admin/gallery_admin.php文件中存在错误的正则表达式:
        193 $allow_file_types = 'gif|jpg|jpeg|png|bmp';
        [...]
        197 if (preg_match('#\.'.$allow_file_types.'?#i',
         $_FILES['grafik']['name'][$i])) {
        [...]
        每个$_FILES['grafik']['name'][$i]变量都包含有上传文件的文件名。仅带有$allow_file_types中所提供的文件名扩展的图形是允许的,但正则表达式还匹配了类似于example.png.php的文件,Webserver将这类文件解释为PHP脚本。这就允许攻击者上传并执行任意PHP脚本。
        
        

- 公告与补丁

        目前厂商已经发布了升级补丁以修复这个安全问题,请到厂商的主页下载:
        http://www.planetc.de/download/planetgallery/planetgallery.html

- 漏洞信息 (F48447)

rt-sa-2006-006.txt (PacketStormID:F48447)
2006-07-24 00:00:00
 
advisory,arbitrary,php
CVE-2006-3676
[点击下载]

planetGallery versions 22.05.2006 and below have a flaw that allows administrators to create new galleries and upload images. Because of a vulnerable regular expression, he may also upload PHP scripts and thereby execute arbitrary commands with the privileges of PHP.

Advisory: Remote command execution in planetGallery

An admin of planetGallery is allowed to create new galleries and upload
images. Because of a vulnerable regular expression, he may also upload
PHP scripts and thereby execute arbitrary commands with the privileges
of PHP.


Details
=======

Product: planetGallery
Affected Versions: <= 22.05.2006
Fixed Versions: 14.07.2006
Vulnerability Type: Remote command execution
Security-Risk: low
Vendor-URL: http://www.planetc.de
Vendor-Status: informed, fixed version released
Advisory-URL: http://www.redteam-pentesting.de/advisories/rt-sa-2006-006.txt
Advisory-Status: public
CVE: CVE-2006-3676
CVE-URL: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2006-3676


Introduction
============

PlanetGallery is a commercial PHP script which is used to publish image
galleries, show image descriptions and send picture postcards generated
from the galleries.


More Details
============

The faulty regular expression is in admin/gallery_admin.php:

193   $allow_file_types = 'gif|jpg|jpeg|png|bmp';
[...]
197   if (preg_match('#\.'.$allow_file_types.'?#i',
          $_FILES['grafik']['name'][$i])) {
[...]

Each variable $_FILES['grafik']['name'][$i] contains the filename of an
uploaded file. Only images with filename extensions supplied in
$allow_file_types are allowed, but the regular expression also matches
files like 'example.png.php'. Webservers interprete this as a PHP script.


Proof of Concept
================

Create a gallery and upload a PHP script named 'evil.png.php'
containing '<?php phpinfo(); ?>'.

Now, access

   http://example.com/planetGalleryPath/images/1/evil.png.php

You should see the phpinfo page.


Workaround
==========

Change line 193 of admin/admin_gallery.php to:

   $allow_file_types = '(gif|jpg|jpeg|png|bmp)';

And line 197 to:

   if (preg_match('#\.'.$allow_file_types.'$#i',
          $_FILES['grafik']['name'][$i])) {


Fix
===

Update to the newest version 14.07.2006.


Security Risk
=============

The attacker has to be admin of planetGallery to exploit this
vulnerability. If your admin directory is protected by a .htaccess file
(as the author strictly recommends), the risk is considered low,
otherwise everybody can impersonate the admin and exploit this
vulnerability.  PlanetGallery is not a multiuser gallery CMS, so the
admin of planetGallery is probably the maintainer of the website who
will have access to the system anyway. RedTeam therefore rates the risk
of this vulnerability as low.


History
=======

2006-07-13 Discovery of vulnerability
2006-07-13 Vendor is informed
2006-07-14 Vendor releases fixed version
2006-07-20 Advisory is released

References
==========

[1] http://www.planetc.de/download/planetgallery/planetgallery.html


RedTeam
=======

RedTeam Pentesting is offering individual penetration tests, short
pentests, performed by a team of specialised IT-security experts.
Hereby, security weaknesses in company networks are uncovered and can be
fixed immediately.

As there are only few experts in this field, RedTeam wants to share its
knowledge and enhance the public knowledge with research in security
related areas. The results are made available as public security
advisories.

More information about RedTeam can be found at
http://www.redteam-pentesting.de.

-- 
RedTeam Pentesting               Tel.: +49-241-963 1300
Dennewartstr. 25-27              Fax : +49-241-963 1304
52068 Aachen           http://www.redteam-pentesting.de
    

- 漏洞信息

27417
planetGallery admin/gallery_admin.php Multiple File Extension Upload Arbitrary Code Execution
Remote / Network Access Input Manipulation
Loss of Integrity
Exploit Public

- 漏洞描述

PlaNet concept planetGallery contains a flaw that may allow a remote attacker to execute arbitrary commands. The issue is due to admin/gallery.php not properly sanitizing user input supplied to the _FILES['grafik']['name'][$i] variable. This may allow an attacker to include a file from a remote host that contains arbitrary commands which will be executed by the vulnerable script.

- 时间线

2006-07-20 2006-07-13
2006-07-20 Unknow

- 解决方案

Upgrade to version 14.07.2006 or higher, as it has been reported to fix this vulnerability. An upgrade is required as there are no known workarounds.

- 相关参考

- 漏洞作者

- 漏洞信息

WikiWebWeaver Index.PHP Arbitrary File Upload Vulnerability
Input Validation Error 19537
Yes No
2006-08-15 12:00:00 2006-09-06 03:33:00
Crackers_Child is credited with the discovery of this vulnerability.

- 受影响的程序版本

WikiWebWeaver WikiWebWeaver 1 beta 2
WikiWebWeaver WikiWebWeaver 1.beta 4

- 不受影响的程序版本

WikiWebWeaver WikiWebWeaver 1.beta 4

- 漏洞讨论

WikiWebWeaver is prone to an arbitrary file-upload vulnerability.

An attacker can exploit this vulnerability to upload malicious script code that will run in the context of the webserver process.

An attacker can exploit this issue by uploading and executing malicious PHP scripts.

- 漏洞利用

Attackers can exploit this issue via a web client.

- 解决方案

The vendor has released security patches to address this issue. Please see the references section for further information.

- 相关参考

 

 

关于SCAP中文社区

SCAP中文社区是国内第一个以SCAP为主题的中文开放社区。了解更多信息,请查阅[关于本站]

版权声明

CVE/CWE/OVAL均为MITRE公司的注册商标,它们的官方数据源均保存在MITRE公司的相关网站