Skip to content

Commit

Permalink
그누보드5 다중 취약점 수정 adm1nkyj( http://adm1nkyj.kr/ ) 제보
Browse files Browse the repository at this point in the history
  • Loading branch information
thisgun committed Oct 17, 2018
1 parent 784f631 commit aa7ffdf
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions adm/contentformupdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
$co_row = sql_fetch($sql);
}

$co_id = preg_replace('/[^a-z0-9_]/i', '', $co_id);
$co_subject = strip_tags($co_subject);
$co_include_head = preg_replace(array("#[\\\]+$#", "#(<\?php|<\?)#i"), "", substr($co_include_head, 0, 255));
$co_include_tail = preg_replace(array("#[\\\]+$#", "#(<\?php|<\?)#i"), "", substr($co_include_tail, 0, 255));
Expand Down Expand Up @@ -59,12 +60,12 @@
}
}

if( $co_include_head && ! is_include_path_check($co_include_head) ){
if( $co_include_head && ! is_include_path_check($co_include_head, 1) ){
$co_include_head = '';
$error_msg = '/data/file/ 또는 /data/editor/ 포함된 문자를 상단 파일 경로에 포함시킬수 없습니다.';
}

if( $co_include_tail && ! is_include_path_check($co_include_tail) ){
if( $co_include_tail && ! is_include_path_check($co_include_tail, 1) ){
$co_include_tail = '';
$error_msg = '/data/file/ 또는 /data/editor/ 포함된 문자를 하단 파일 경로에 포함시킬수 없습니다.';
}
Expand Down
2 changes: 2 additions & 0 deletions bbs/content.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php
include_once('./_common.php');

$co_id = preg_replace('/[^a-z0-9_]/i', '', $co_id);

//dbconfig파일에 $g5['content_table'] 배열변수가 있는지 체크
if( !isset($g5['content_table']) ){
die('<meta charset="utf-8">관리자 모드에서 게시판관리->내용 관리를 먼저 확인해 주세요.');
Expand Down
3 changes: 1 addition & 2 deletions bbs/view_image.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
$g5['title'] = '이미지 크게보기';
include_once(G5_PATH.'/head.sub.php');

$filename = $_GET['fn'];
$bo_table = $_GET['bo_table'];
$filename = preg_replace('/[^A-Za-z0-9 _ .-]/', '', $_GET['fn']);

if(strpos($filename, 'data/editor')) {
$editor_file = strstr($filename, 'editor');
Expand Down
1 change: 1 addition & 0 deletions g4_import_run.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ function noRefresh()
<?php
flush();

$g4 = array();
// g4의 confing.php
require('./'.$g4_config_file);

Expand Down

0 comments on commit aa7ffdf

Please sign in to comment.