某模块未对上传文件类型进行验证。可上传任意文件5 D6 o/ ^# ]) T6 _/ Z$ U9 q0 o4 J% a
" r; d" U4 {/ a& k# D/ b7 i
. \. f! k+ N! K& k' z5 C% i
, |! g, O4 i/ g) d代码产生位置
: }2 U/ r$ l) b* Capps\wap\Lib\Action\IndexAction.class.php0 ~/ P1 u, n2 U& L" A: h
263行' A; R1 i4 `( M( [' l
if(!empty($_FILES['pic']['name'])) { // 自动发一条图片微博
( z% ~; s& s8 }4 z1 D$data['pic'] = $_FILES['pic'];6 Y7 q p! L8 {; c+ t
$data['content'] = '图片分享';. F, C l. e; d& z h9 `: C0 h
$data['from'] = $this->_type_wap;, p& X2 ~% c1 R
$res = api('Statuses')->data($data)->upload();
. u4 n* i# Y6 j; l/ |5 r}
9 Y" I% L6 R( I % \1 M' |+ ?8 C( I) a
未对文件类型过滤0 i6 a4 G5 {, Q0 L, p( G
$ h9 t; S/ y, D7 `- C0 m访问wap 模块
`% y' U4 Y5 a3 F9 b Z8 e& R3 o t
9 v. A& C8 e2 q3 |4 H发一条微博并传图* J) A3 E" H2 l$ H2 \
6 B' x9 o. v: ]
firebug 地址0 ]6 o1 P' ]& X% ?2 \4 y
8 K9 v# v0 K% Z; ~9 m
# } ~# Z- h7 f; {' {' H6 d
6 E5 T, B8 y t L
# \7 ]. I! q/ ~% z2 U" U
去掉small_然后访问
) O5 C* L) D( O1 {3 N6 T) M# P+ Y0 }2 f- D
http://www.myhack58.com/data/upl ... 7/50865d481c217.php3 ]3 O5 N+ X3 M( j: ?) C2 Y
, h9 L+ V' r8 k/ f# y+ Q) X
2 w. a9 n/ `! k; D( d6 e6 R- J2 L c) f6 Q
修复方案:
' W2 ~% N9 b- I8 Y# P: N
9 N( c; I& Y4 k% y0 z n对上传类型要进行检查+ l R! f# M/ y4 r4 A" q; F
: c0 F, m8 f0 r# R4 X5 |
% ]; t2 i% ^5 y. M$ X |