[KVE-2026-1640] 1:1 문의 접근권한 우회 취약점 수정
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> (cherry picked from commit a719c6ea5f6d38350f9dcda682a04dad31f6a454)
This commit is contained in:
1 parent
11a26c82af
commit
b3aa81c74a
4 files changed
+23
-7
No files matched your search
+15
-1
@@ -11,11 +11,25 @@ $no = isset($_REQUEST['no']) ? (int) $_REQUEST['no'] : 0;
|
||||
if (!get_session('ss_qa_view_'.$qa_id))
|
||||
alert('잘못된 접근입니다.');
|
||||
|
||||
$sql = " select qa_subject, qa_file{$no}, qa_source{$no} from {$g5['qa_content_table']} where qa_id = '$qa_id' ";
|
||||
$sql = " select qa_subject, mb_id, qa_type, qa_parent, qa_file{$no}, qa_source{$no} from {$g5['qa_content_table']} where qa_id = '$qa_id' ";
|
||||
$file = sql_fetch($sql);
|
||||
if (!$file['qa_file'.$no])
|
||||
alert_close('파일 정보가 존재하지 않습니다.');
|
||||
|
||||
// 세션 표식만으로는 권한을 보장하지 못하므로 문의 스레드의 실제 소유자를 다시 확인
|
||||
if ($is_admin !== 'super') {
|
||||
if ($file['qa_type']) {
|
||||
// 답변 첨부는 부모 질문의 소유자를 기준으로 판정
|
||||
$parent = sql_fetch(" select mb_id from {$g5['qa_content_table']} where qa_id = '{$file['qa_parent']}' ");
|
||||
$thread_owner = isset($parent['mb_id']) ? $parent['mb_id'] : '';
|
||||
} else {
|
||||
$thread_owner = $file['mb_id'];
|
||||
}
|
||||
|
||||
if (! ($is_member && $thread_owner !== '' && $thread_owner === $member['mb_id']))
|
||||
alert('다운로드 권한이 없습니다.');
|
||||
}
|
||||
|
||||
if($is_guest) {
|
||||
alert('다운로드 권한이 없습니다.\\n회원이시라면 로그인 후 이용해 보십시오.', G5_BBS_URL.'/login.php?url='.urlencode(G5_BBS_URL.'/qaview.php?qa_id='.$qa_id));
|
||||
}
|
||||
|
||||
+2
-1
@@ -47,7 +47,8 @@ if(is_file($skin_file)) {
|
||||
$sql_common = " from {$g5['qa_content_table']} ";
|
||||
$sql_search = " where qa_type = '0' ";
|
||||
|
||||
if(!$is_admin)
|
||||
// 최고관리자가 아니면 본인 문의만 조회 (게시판/그룹 관리자 문맥으로 우회 불가)
|
||||
if($is_admin !== 'super')
|
||||
$sql_search .= " and mb_id = '{$member['mb_id']}' ";
|
||||
|
||||
if($sca) {
|
||||
|
||||
+2
-2
@@ -21,7 +21,7 @@ $skin_file = $qa_skin_path.'/view.skin.php';
|
||||
|
||||
if(is_file($skin_file)) {
|
||||
$sql = " select * from {$g5['qa_content_table']} where qa_id = '$qa_id' ";
|
||||
if(!$is_admin) {
|
||||
if($is_admin !== 'super') {
|
||||
$sql .= " and mb_id = '{$member['mb_id']}' ";
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ if(is_file($skin_file)) {
|
||||
$sql = " select qa_id, qa_subject
|
||||
from {$g5['qa_content_table']}
|
||||
where qa_type = '0' ";
|
||||
if(!$is_admin) {
|
||||
if($is_admin !== 'super') {
|
||||
$sql .= " and mb_id = '{$member['mb_id']}' ";
|
||||
}
|
||||
|
||||
|
||||
@@ -98,11 +98,12 @@ for ($i=1; $i<=5; $i++) {
|
||||
}
|
||||
|
||||
if($w == 'u' || $w == 'a' || $w == 'r') {
|
||||
if($w == 'a' && !$is_admin)
|
||||
if($w == 'a' && $is_admin !== 'super')
|
||||
alert('답변은 관리자만 등록할 수 있습니다.');
|
||||
|
||||
$sql = " select * from {$g5['qa_content_table']} where qa_id = '$qa_id' ";
|
||||
if(!$is_admin) {
|
||||
// 최고관리자가 아니면 본인 문의만 대상으로 (게시판/그룹 관리자 문맥으로 우회 불가)
|
||||
if($is_admin !== 'super') {
|
||||
$sql .= " and mb_id = '{$member['mb_id']}' ";
|
||||
}
|
||||
|
||||
@@ -112,7 +113,7 @@ if($w == 'u' || $w == 'a' || $w == 'r') {
|
||||
if(!$write['qa_id'])
|
||||
alert('게시글이 존재하지 않습니다.\\n삭제되었거나 자신의 글이 아닌 경우입니다.');
|
||||
|
||||
if(!$is_admin) {
|
||||
if($is_admin !== 'super') {
|
||||
if($write['qa_type'] == 0 && $write['qa_status'] == 1)
|
||||
alert('답변이 등록된 문의글은 수정할 수 없습니다.');
|
||||
|
||||
|
||||
Reference in new issue
Block a user