Piwigo是用PHP编写的相册脚本。/ o4 i8 u7 c: B; I
% m7 g) h* e0 `5 s# X; ]( |
Piwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。
8 S. \& F5 L* ~( |& O====================================================================0 }+ s, z1 {( R' Q0 g" e O: x/ T* W, R
/install.php:# |2 F) e; D. F5 u9 K W
-------------, P* _# e* {& G1 d% k; V4 s) ~
113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']))
! c0 o2 Z, O; u# e- A. q7 m114: {
% c# f* u v5 @5 U+ k2 y! G4 {; ~115: $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];& Q7 W( C( H* X5 ] g0 j
116: header('Cache-Control: no-cache, must-revalidate');. d, Q+ ~# F' E) m: h1 e( O. C
117: header('Pragma: no-cache');& ?: v! `: B( _
118: header('Content-Disposition: attachment; filename="database.inc.php"');
4 G( A- h z: v119: header('Content-Transfer-Encoding: binary');% { s9 V$ w0 |: ^2 X' C2 l
120: header('Content-Length: '.filesize($filename));
2 {' [0 ]2 u) _! X* H121: echo file_get_contents($filename);
' z! h! M" x9 A: z7 ?122: unlink($filename);, T1 j. K' V, u/ f3 T
123: exit();- e {. N. i4 y$ h4 C0 D1 X, z" o
124: }! ?. m, X5 j- T+ r1 G
====================================================================
' [! W8 \' r' O [& c- P# o) {
/ _' \8 c, j' K. q- \Tested on: Microsoft Windows 7 Ultimate SP1 (EN)* B6 V8 S+ i, [, Y( J4 {' a/ w
Apache 2.4.2 (Win32)* Y* U( h" V& K( O: I
PHP 5.4.4" `6 a& R7 O. U4 B2 ~( ^! b D- V
MySQL 5.5.25a1 E. q# l5 U" Q& p8 P4 q u" z7 y# r
5 ]* n o2 C; X6 |# ~3 F9 b+ DVulnerability discovered by Gjoko 'LiquidWorm' Krstic
$ I3 T4 |4 P: K5 f& \, d- \* @ @zeroscience) _9 p* ~9 U9 r' y& V
! ?! {9 S6 Y7 ?! K, wAdvisory ID: ZSL-2013-5127. e) c: k( w0 j- b% Y8 H
Advisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php
9 H2 f! ^: V7 @6 s5 h4 P; dVendor Patch: http://piwigo.org/bugs/view.php?id=2843
. b4 k% T' A8 _7 w+ `' x
/ O; i3 t8 u# X, y. c9 o& v) X* H15.02.2013
* A( N5 `7 ]+ @7 s" B8 A9 E7 w; N9 w
" z/ h" w+ C- P% G! W--
0 H- M4 D2 r# m2 V- d0 Ehttp://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt
1 l7 }0 ` Y* m$ J1 Y ! Z2 j1 T6 L; ^9 [; h7 k0 z
|