[ ... ]
if( $co_include_head && ! is_include_path_check($co_include_head) ){
$co_include_head = '';
$error_msg = '/data/file/ 또는 /data/editor/ 포함된 문자를 상단 파일 경로에 포함시킬수 없습니다.';
}
if( $co_include_tail && ! is_include_path_check($co_include_tail) ){
$co_include_tail = '';
$error_msg = '/data/file/ 또는 /data/editor/ 포함된 문자를 하단 파일 경로에 포함시킬수 없습니다.';
}
[ ... ]
> 패치 분석
파일 동작 설명: adm/contentformupdate.php 파일은 adm/contentform.php에서 전달된 form에 대한 정보를 DB에 설정을 저장/변경한다.
contentform.php에서 $_POST로 오는 ‘co_include_tail’과 ‘co_include_head’에 대해 경로에 대한 필터링이 존재 하지 않는다.
이에 파일을 업/다운로드 할 수 있는 폴더인 data/file 과 data/editor의 대한 접근을 차단하여 취약점이 패치 되었다.
취약점 발생 위치
http://[GNU_BOARD_HOST]/adm/contentform.php
가정: \[GNU_BOARD_PATH]\data\file에 phpinfo를 출력하는 코드가 담긴 “test.php”라는 php 파일이 저장되있음.
상단 또는 하단 파일 경로에 “test.php”가 저장된 경로를 입력한 뒤 확인,
아래 확인 옆 “목록” 에 들어가 등록한 글을 보거나 http://[GNU_BOARD_HOST]/adm/content.php?co_id=[글 ID] 로 들어가 볼 수 있다. 해당 글을 보게 되면,
[ ... ]
$error_msg = '';
if( $qa_include_head && ! is_include_path_check($qa_include_head) ){
$qa_include_head = '';
$error_msg = '/data/file/ 또는 /data/editor/ 포함된 문자를 상단 파일 경로에 포함시킬수 없습니다.';
}
if( $qa_include_tail && ! is_include_path_check($qa_include_tail) ){
$qa_include_tail = '';
$error_msg = '/data/file/ 또는 /data/editor/ 포함된 문자를 하단 파일 경로에 포함시킬수 없습니다.';
}
[ ... ]
qa_include_head = '{$qa_include_head}',
qa_include_tail = '{$qa_include_tail}',
[ ... ]
> 패치 분석
파일 동작 설명: adm/qa_config_update.php 파일은 adm/qa_config.php에서 전달된 form에 대한 정보를 DB에 설정을 저장/변경한다.
qa_config.php에서 $_POST로 오는 ‘qa_include_tail’과 ‘qa_include_head’에 대해 경로에 대한 필터링이 존재 하지 않는다.
이에 파일을 업/다운로드 할 수 있는 폴더인 data/file 과 data/editor의 대한 접근을 차단하여 취약점이 패치 되었다.
취약점 발생 위치
http://[GNU_BOARD_HOST]/adm/qa_config.php
가정: \[GNU_BOARD_PATH]\data\file에 phpinfo를 출력하는 코드가 담긴 “test.php”라는 php 파일이 저장되있음.
상단 또는 하단 파일 경로에 “test.php”가 저장된 경로를 입력한 뒤 확인,
아래 확인 옆 “목록” 에 들어가 등록한 글을 보거나 http://[GNU_BOARD_HOST]/adm/content.php?co_id=[글 ID] 로 들어가 볼 수 있다. 해당 글을 보게 되면,
[ ... ]
if(!is_include_path_check($_POST['bo_include_head'])) {
alert('/data/file/ 또는 /data/editor/ 포함된 문자를 상단 파일 경로에 포함시킬수 없습니다.');
}
if(!is_include_path_check($_POST['bo_include_tail'])) {
alert('/data/file/ 또는 /data/editor/ 포함된 문자를 하단 파일 경로에 포함시킬수 없습니다.');
}
[ ... ]
> 패치 분석
파일 동작 설명: adm/board_form_update.php 파일은 adm/board_form.php에서 전달된 정보를 게시판의 form을 DB에 저장/변경한다.
board_form.php에서 $_POST로 오는 ‘bo_include_head’과 ‘bo_include_tail’에 대해 경로에 대한 필터링이 존재 하지 않는다.
이에 파일을 업/다운로드 할 수 있는 폴더인 data/file 과 data/editor의 대한 접근을 차단하여 취약점이 패치 되었다.