Skip to content

Commit e713f69

Browse files
author
Isshu Rakusai
committedMar 27, 2013
Fix security issue : xss
1 parent 0dfe55c commit e713f69

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed
 

‎nota/default/nota.pl

+1
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ sub nota_validate
259259
if ($option eq "path"){
260260
#ファイル名であるか(特にスラッシュの混入を防ぐ)
261261
$text =~ s/(:|;|\/|\\|\r|\n)//g;
262+
$text =~ s/^[\.]*//g;
262263
$text =~ s/[\x00-\x08\x0B-\x1F]//g; #制御コードを消去
263264
}
264265
elsif ($option eq "uri" || $option eq "url"){

‎nota/default/read.cgi

+4
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ sub main
4040
if (!defined($page) || $page eq ""){
4141
$page = 'home';
4242
}
43+
44+
#バリデーション
45+
&nota_validate($page);
46+
4347
#ログイン情報の取得
4448
local $login = NOTA::Login->new;
4549
$login->getlogin(\%COOKIE);

0 commit comments

Comments
 (0)
Please sign in to comment.