发布时间 :2006-07-24 08:19:00
修订时间 :2017-07-19 21:32:29

[原文]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)

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

- CVSS (基础分值)

CVSS分值: 5.1 [中等(MEDIUM)]
机密性影响: [--]
完整性影响: [--]
可用性影响: [--]
攻击复杂度: [--]
攻击向量: [--]
身份认证: [--]

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


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


- 官方数据库链接
(官方数据源) MITRE
(官方数据源) NVD
(官方数据源) CNNVD

- 其它链接及资源
(UNKNOWN)  FULLDISC  20060720 Advisory: Remote command execution in planetGallery
(VENDOR_ADVISORY)  BUGTRAQ  20060720 Advisory: Remote command execution in planetGallery
(PATCH)  BID  19091
(UNKNOWN)  XF  planetgallery-galleryadmin-file-upload(27858)

- 漏洞信息

PlanetGallery 'gallery_admin.php'任意文件上传漏洞
中危 输入验证
2006-07-24 00:00:00 2006-08-07 00:00:00
        193 $allow_file_types = 'gif|jpg|jpeg|png|bmp';
        197 if (preg_match('#\.'.$allow_file_types.'?#i',
         $_FILES['grafik']['name'][$i])) {

- 公告与补丁


- 漏洞信息 (F48447)

rt-sa-2006-006.txt (PacketStormID:F48447)
2006-07-24 00:00:00

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.


Product: planetGallery
Affected Versions: <= 22.05.2006
Fixed Versions: 14.07.2006
Vulnerability Type: Remote command execution
Security-Risk: low
Vendor-Status: informed, fixed version released
Advisory-Status: public
CVE: CVE-2006-3676


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

You should see the phpinfo page.


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])) {


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.


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




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

More information about RedTeam can be found at

RedTeam Pentesting               Tel.: +49-241-963 1300
Dennewartstr. 25-27              Fax : +49-241-963 1304
52068 Aachen 

- 漏洞信息

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.

- 相关参考