Skip to content

Commit

Permalink
KVE-2021-1116 그누보드 XSS 취약점 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
thisgun committed Jul 26, 2022
1 parent a6e302f commit 71f58f3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
9 changes: 5 additions & 4 deletions adm/board_form.php
Expand Up @@ -914,7 +914,7 @@
<tr>
<th scope="row"><label for="bo_include_head">상단 파일 경로</label></th>
<td>
<input type="text" name="bo_include_head" value="<?php echo $board['bo_include_head'] ?>" id="bo_include_head" class="frm_input" size="50">
<input type="text" name="bo_include_head" value="<?php echo get_sanitize_input($board['bo_include_head']); ?>" id="bo_include_head" class="frm_input" size="50">
</td>
<td class="td_grpset">
<input type="checkbox" name="chk_grp_include_head" value="1" id="chk_grp_include_head">
Expand All @@ -926,7 +926,7 @@
<tr>
<th scope="row"><label for="bo_include_tail">하단 파일 경로</label></th>
<td>
<input type="text" name="bo_include_tail" value="<?php echo $board['bo_include_tail'] ?>" id="bo_include_tail" class="frm_input" size="50">
<input type="text" name="bo_include_tail" value="<?php echo get_sanitize_input($board['bo_include_tail']); ?>" id="bo_include_tail" class="frm_input" size="50">
</td>
<td class="td_grpset">
<input type="checkbox" name="chk_grp_include_tail" value="1" id="chk_grp_include_tail">
Expand Down Expand Up @@ -1423,9 +1423,10 @@ function use_captcha_check(){
});
}

var bo_include_head = jQuery.trim(jQuery("#bo_include_head").val()),
bo_include_tail = jQuery.trim(jQuery("#bo_include_tail").val());

function frm_check_file(){
var bo_include_head = "<?php echo $board['bo_include_head']; ?>";
var bo_include_tail = "<?php echo $board['bo_include_tail']; ?>";
var head = jQuery.trim(jQuery("#bo_include_head").val());
var tail = jQuery.trim(jQuery("#bo_include_tail").val());

Expand Down
4 changes: 2 additions & 2 deletions adm/contentform.php
Expand Up @@ -137,14 +137,14 @@
<th scope="row"><label for="co_include_head">상단 파일 경로</label></th>
<td>
<?php echo help("설정값이 없으면 기본 상단 파일을 사용합니다."); ?>
<input type="text" name="co_include_head" value="<?php echo $co['co_include_head']; ?>" id="co_include_head" class="frm_input" size="60">
<input type="text" name="co_include_head" value="<?php echo get_sanitize_input($co['co_include_head']); ?>" id="co_include_head" class="frm_input" size="60">
</td>
</tr>
<tr>
<th scope="row"><label for="co_include_tail">하단 파일 경로</label></th>
<td>
<?php echo help("설정값이 없으면 기본 하단 파일을 사용합니다."); ?>
<input type="text" name="co_include_tail" value="<?php echo $co['co_include_tail']; ?>" id="co_include_tail" class="frm_input" size="60">
<input type="text" name="co_include_tail" value="<?php echo get_sanitize_input($co['co_include_tail']); ?>" id="co_include_tail" class="frm_input" size="60">
</td>
</tr>
<tr id="admin_captcha_box" style="display:none;">
Expand Down
10 changes: 5 additions & 5 deletions adm/qa_config.php
Expand Up @@ -266,13 +266,13 @@
<tr>
<th scope="row"><label for="qa_include_head">상단 파일 경로</label></th>
<td>
<input type="text" name="qa_include_head" value="<?php echo $qaconfig['qa_include_head'] ?>" id="qa_include_head" class="frm_input" size="50">
<input type="text" name="qa_include_head" value="<?php echo get_sanitize_input($qaconfig['qa_include_head']); ?>" id="qa_include_head" class="frm_input" size="50">
</td>
</tr>
<tr>
<th scope="row"><label for="qa_include_tail">하단 파일 경로</label></th>
<td>
<input type="text" name="qa_include_tail" value="<?php echo $qaconfig['qa_include_tail'] ?>" id="qa_include_tail" class="frm_input" size="50">
<input type="text" name="qa_include_tail" value="<?php echo get_sanitize_input($qaconfig['qa_include_tail']); ?>" id="qa_include_tail" class="frm_input" size="50">
</td>
</tr>
<tr id="admin_captcha_box" style="display:none;">
Expand Down Expand Up @@ -344,7 +344,9 @@
</form>

<script>
var captcha_chk = false;
var captcha_chk = false,
qa_include_head = jQuery.trim(jQuery("#qa_include_head").val()),
qa_include_tail = jQuery.trim(jQuery("#qa_include_tail").val());

function use_captcha_check() {
$.ajax({
Expand All @@ -361,8 +363,6 @@ function use_captcha_check() {
}

function frm_check_file() {
var qa_include_head = "<?php echo $qaconfig['qa_include_head']; ?>";
var qa_include_tail = "<?php echo $qaconfig['qa_include_tail']; ?>";
var head = jQuery.trim(jQuery("#qa_include_head").val());
var tail = jQuery.trim(jQuery("#qa_include_tail").val());

Expand Down
2 changes: 1 addition & 1 deletion lib/common.lib.php
Expand Up @@ -3965,7 +3965,7 @@ function get_random_token_string($length=6)
}

function filter_input_include_path($path){
return str_replace('//', '/', $path);
return str_replace('//', '/', strip_tags($path));
}

function option_array_checked($option, $arr=array()){
Expand Down

0 comments on commit 71f58f3

Please sign in to comment.