Piwigo是用PHP编写的相册脚本。
% @0 a2 h4 `, S( A/ k/ e' p4 `6 g2 l7 o- R& N! t7 Q
Piwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。4 U1 z: z, \% y% T0 ^7 E- p* t
====================================================================
9 ^/ _* r: l+ S1 E. }$ I+ D, M/install.php:
3 R' Y7 h+ {4 q6 f$ E-------------
" p# ~; Y7 G v1 `113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']))
' G5 Z. Y9 J. M% ], S9 d ~4 Z) p$ x114: {# d* N2 B8 s* z, _
115: $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];
3 E. I$ F' h( S0 c6 o9 R116: header('Cache-Control: no-cache, must-revalidate');- M# e1 C6 r6 C! E
117: header('Pragma: no-cache');
9 k$ C4 ~1 ] H8 s* ~) t/ }- h118: header('Content-Disposition: attachment; filename="database.inc.php"');
" S) B: M8 E; W/ I119: header('Content-Transfer-Encoding: binary');
O. V- A/ ~& D* ?3 } s/ X120: header('Content-Length: '.filesize($filename));
* T' }& K2 S* v# g [0 @/ b% q3 M) D121: echo file_get_contents($filename);
$ z) b% L9 R$ }- X& ?122: unlink($filename);
|$ e- E9 T( i+ r6 _123: exit();8 X' Y7 H+ z G( v8 O( ~ P
124: }9 @: [- A. w: Z; d; [6 ~& l2 O
====================================================================
9 E7 n _) [$ q/ N 1 w$ e5 k8 a! Q9 ^9 s$ ]
Tested on: Microsoft Windows 7 Ultimate SP1 (EN)
, l( v/ |5 H) n }/ V Apache 2.4.2 (Win32)! x2 [9 o9 K* J+ I
PHP 5.4.4
- |) W3 w3 I; Q1 h* L3 v. k MySQL 5.5.25a. i, b& f+ O. h5 e( e
. ^1 G7 T1 F- l6 d3 \3 P! E: m
Vulnerability discovered by Gjoko 'LiquidWorm' Krstic
: n: f3 n' C+ E0 I: n- k @zeroscience
. S/ F2 @; a& m% e, H' E / ]) D4 j$ }8 {' ~9 i& p- d
Advisory ID: ZSL-2013-5127; {& Z1 e7 M. Q" l: A
Advisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php. V' `1 F) X* i+ ?0 G' e
Vendor Patch: http://piwigo.org/bugs/view.php?id=2843! q- T7 Y B" \( L' K" s6 n
- H* q6 ^/ J3 r" |' Z# Y3 z& l15.02.2013
8 v/ }$ x; K3 |: [4 [4 o $ F9 c4 @3 `3 M$ D
--
; w5 }# [ t7 q; |/ Nhttp://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt* F( r) s+ S- J1 K9 g: k; ] o
& H* m# q4 b8 A% _ |