Skip to content

Commit

Permalink
KVE-2018-1808 취약점 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
thisgun committed Dec 12, 2018
1 parent 82078fc commit 038affe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion adm/admin.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ function admin_check_xss_params($params){

if( is_array($value) ){
admin_check_xss_params($params);
} else if ( preg_match('/<\s?[^\>]*\/?\s?>/i', $value) && preg_match('/script.*?\/script/ius', $value) ){
} else if ( preg_match('/<\s?[^\>]*\/?\s?>/i', $value) && (preg_match('/script.*?\/script/ius', $value) || preg_match('/onload=.*/ius', $value)) ){
alert('요청 쿼리에 잘못된 스크립트문장이 있습니다.\\nXSS 공격일수도 있습니다.');
die();
}
Expand Down
6 changes: 5 additions & 1 deletion bbs/alert.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,17 @@
<form method="post" action="<?php echo $url ?>">
<?php
foreach($_POST as $key => $value) {

$key = clean_xss_tags($url);
$value = clean_xss_tags($value);

if(strlen($value) < 1)
continue;

if(preg_match("/pass|pwd|capt|url/", $key))
continue;
?>
<input type="hidden" name="<?php echo $key ?>" value="<?php echo $value ?>">
<input type="hidden" name="<?php echo htmlspecialchars($key); ?>" value="<?php echo htmlspecialchars($value); ?>">
<?php
}
?>
Expand Down

0 comments on commit 038affe

Please sign in to comment.