找回密码
 立即注册
查看: 2967|回复: 0
打印 上一主题 下一主题

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

[复制链接]
跳转到指定楼层
楼主
发表于 2013-3-14 20:15:53 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
Piwigo是用PHP编写的相册脚本。
. D& @: q& r$ S# [9 D: H/ W8 x
5 w1 x! n8 h6 r$ y1 e/ n6 }9 nPiwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。
3 ~9 |$ }% R5 W9 S8 W& Y====================================================================
+ s* k) v5 }' A" ~/install.php:& p  y; \* f/ i$ Y/ Q& A( z
-------------0 G9 `9 ]. }" i4 f( j1 w! {
113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']))5 g# P2 L+ C9 R( ?3 v
114: {  I: H+ j# b8 t: X
115:   $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];
# ^5 y5 j9 e0 U% R" ]116:   header('Cache-Control: no-cache, must-revalidate');
' A# D# R) Q# g1 s117:   header('Pragma: no-cache');
8 z' E7 }) Y- K% c( t# y118:   header('Content-Disposition: attachment; filename="database.inc.php"');$ V, P- D7 J0 d1 T$ X6 [! U
119:   header('Content-Transfer-Encoding: binary');/ j; l8 x  M" ~8 z
120:   header('Content-Length: '.filesize($filename));
, m5 N& P; T3 X3 \; V! h121:   echo file_get_contents($filename);" W: e$ j1 ?2 r1 e& E  |$ ~
122:   unlink($filename);' S5 L8 v, T, P8 V. B. p
123:   exit();* j* E8 d6 e! N: I* j+ U
124: }1 M. h" w& z, v; {
====================================================================
5 `0 o" K7 t! a% H% \" l ; U% q: v  ]$ \* L
Tested on: Microsoft Windows 7 Ultimate SP1 (EN)
: l$ c" |. s% h4 A6 E           Apache 2.4.2 (Win32)3 y0 \8 R; f) X( L, D1 V( b
           PHP 5.4.4) X3 H* C/ h, v3 d* J; G
           MySQL 5.5.25a, H" q5 A/ |! k% }" d$ [5 Q3 E
3 @" j  P) H' I9 G1 B4 n
Vulnerability discovered by Gjoko 'LiquidWorm' Krstic: _& Y9 y" r4 P  A( l) s2 L" B
                            @zeroscience4 Y; B8 x( q* Y; O
) Y; e. ^9 @' I1 Z4 F# }: p+ g. `7 Z6 N
Advisory ID: ZSL-2013-5127
8 W: G, Q  ]& j2 R6 P) ~Advisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php
, N$ ?+ ]6 T! Z; g: u3 O" b. G8 l9 cVendor Patch: http://piwigo.org/bugs/view.php?id=2843( @% n7 @  y% j

" N: J0 Z9 y& h7 F, k15.02.2013
5 B0 n# W$ z  W$ A9 i
" D- G( O8 w* P5 A, d8 ^--
  I/ g9 W  A3 G" Shttp://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt
, a) o: `$ O( s- g) t2 j1 A - O) i$ O7 \$ {# G: i7 N
回复

使用道具 举报

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

本版积分规则

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