댓글 수정 CSRF 취약점 수정
This commit is contained in:
14
bbs/ajax.comment_token.php
Normal file
14
bbs/ajax.comment_token.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
include_once('./_common.php');
|
||||
include_once(G5_LIB_PATH.'/json.lib.php');
|
||||
|
||||
$ss_name = 'ss_comment_token';
|
||||
|
||||
set_session($ss_name, '');
|
||||
|
||||
$token = _token();
|
||||
|
||||
set_session($ss_name, $token);
|
||||
|
||||
die(json_encode(array('token'=>$token)));
|
||||
?>
|
||||
@ -3,6 +3,11 @@ define('G5_CAPTCHA', true);
|
||||
include_once('./_common.php');
|
||||
include_once(G5_CAPTCHA_PATH.'/captcha.lib.php');
|
||||
|
||||
// 토큰체크
|
||||
$comment_token = trim(get_session('ss_comment_token'));
|
||||
if(!trim($_POST['token']) || !$comment_token || $comment_token != $_POST['token'])
|
||||
alert('올바른 방법으로 이용해 주십시오.');
|
||||
|
||||
// 090710
|
||||
if (substr_count($wr_content, "&#") > 50) {
|
||||
alert('내용에 올바르지 않은 코드가 다수 포함되어 있습니다.');
|
||||
|
||||
Reference in New Issue
Block a user