[CBRD-26777] enhance securities#134
Conversation
|
Reviews (1): Last reviewed commit: "[CBRD-26777] remove master key" | Re-trigger Greptile |
|
Reviews (2): Last reviewed commit: "[CBRD-26777] fix error for use of macro ..." | Re-trigger Greptile |
|
Reviews (3): Last reviewed commit: "[CBRD-26777] rewrite return values accor..." | Re-trigger Greptile |
|
|
Reviews (5): Last reviewed commit: "[CBRD-26777] replace stat to lstat for L..." | Re-trigger Greptile |
|
Reviews (6): Last reviewed commit: "[CBRD-26777] do nothing at uRemoveDir ()..." | Re-trigger Greptile |
|
Reviews (7): Last reviewed commit: "[CBRD-26777] fix compile error" | Re-trigger Greptile |
|
Reviews (8): Last reviewed commit: "[CBRD-26777] add static keyword for dele..." | Re-trigger Greptile |
|
Reviews (9): Last reviewed commit: "[CBRD-26777] check invalid filename patt..." | Re-trigger Greptile |
| #if defined (WINDOWS) | ||
| const std::string FORBIDDEN_CHARS = " \t$&(|)><\n\r*;"; | ||
| #else | ||
| const std::string FORBIDDEN_CHARS = " \t%&(|)><\n\r;*"; |
There was a problem hiding this comment.
FORBIDDEN_CHARS에서 백틱(`) 추가가 필요해보입니다.
벡틱을 거르지 못하면 명령어로 인식될 문제가 발생할 것 같네요.
There was a problem hiding this comment.
그럴것 같네요. backtick을 파일명에 사용할수 있는 문자에서 제외하겠습니다.
comment 감사합니다.
|
다음 2가지 함수는 호출부가 없거나 호출부가 #if 0로 제외되어 있습니다. |
|
|
||
| while (i < len) | ||
| { | ||
| #if defined(_WIN32) || defined(_WIN64) |
There was a problem hiding this comment.
매크로를 #if defined (WINDOWS) 로 통일하는 것이 좋겠습니다. (해당 파일 내부에서는 WINDOWS 로 사용하고 있습니다.)
혹시 _WIN32 와 _WIN64로 분리한 이유가 있을까요 ?
WINDOWS 도 통일하면 cub_manager.vcxproj 에서도 WINDOWS만 정의해도컴파일이 될 것 같네요.
There was a problem hiding this comment.
#if defined (WINDOWS)로 통일하겠습니다.
|
Reviews (47): Last reviewed commit: "[CBRD-26777] add the backtick to the lis..." | Re-trigger Greptile |
|
|
Reviews (49): Last reviewed commit: "[CBRD-26777] do not check full path, che..." | Re-trigger Greptile |
…ly is_invalid_filename_with_msg ()
|
Reviews (50): Last reviewed commit: "[CBRD-26777] apply is_authorized_filenam..." | Re-trigger Greptile |
…erate_update_script (), is_process_running ()
|
@mhoh3963 |
|
Reviews (51): Last reviewed commit: "[CBRD-26777] remove unused function, bot..." | Re-trigger Greptile |
|
|
Reviews (53): Last reviewed commit: "[CBRD-26777] replace system (rm file) to..." | Re-trigger Greptile |
|
Reviews (54): Last reviewed commit: "[CBRD-26777] limit conf filename, by gre..." | Re-trigger Greptile |
| if (std::isalpha (static_cast <unsigned char> (confname.c_str ()[0]))) | ||
| { | ||
| if (attempt_to_access_parent_dir (confname.c_str ())) | ||
| { | ||
| snprintf (_dbmt_error, "filename type is not allowed: %s", confname.c_str ()); | ||
| return build_server_header (response, ERR_FILE_OPEN_FAIL, _dbmt_error); | ||
| } | ||
|
|
||
| if (is_invalid_filename_with_msg (confname.c_str (), _dbmt_error)) | ||
| { | ||
| return build_server_header (response, ERR_FILE_OPEN_FAIL, _dbmt_error); | ||
| } | ||
| } | ||
| else | ||
| { | ||
| if (!is_authorized_filename (confname.c_str (), _dbmt_error)) | ||
| { | ||
| return build_server_header (response, ERR_FILE_OPEN_FAIL, _dbmt_error); | ||
| } | ||
| } |
There was a problem hiding this comment.
static 함수를 외부 번역 단위에서 호출 — 컴파일 오류
attempt_to_access_parent_dir는 cm_server_util.cpp 안에서 static bool로 선언·정의되어 있어 해당 파일 내부에서만 링키지가 유효합니다. cm_server_util.h에도 선언이 없으므로, cm_server_extend_interface.cpp에서 이를 호출하면 "undeclared function" 컴파일 오류가 발생합니다. 이 함수를 헤더에 공개하거나, 대신 이미 공개된 is_authorized_filename / is_invalid_filename_with_msg 조합으로 검증 로직을 대체해야 합니다.
| if (std::isalpha (static_cast <unsigned char> (confname.c_str ()[0]))) | |
| { | |
| if (attempt_to_access_parent_dir (confname.c_str ())) | |
| { | |
| snprintf (_dbmt_error, "filename type is not allowed: %s", confname.c_str ()); | |
| return build_server_header (response, ERR_FILE_OPEN_FAIL, _dbmt_error); | |
| } | |
| if (is_invalid_filename_with_msg (confname.c_str (), _dbmt_error)) | |
| { | |
| return build_server_header (response, ERR_FILE_OPEN_FAIL, _dbmt_error); | |
| } | |
| } | |
| else | |
| { | |
| if (!is_authorized_filename (confname.c_str (), _dbmt_error)) | |
| { | |
| return build_server_header (response, ERR_FILE_OPEN_FAIL, _dbmt_error); | |
| } | |
| } | |
| if (!is_authorized_filename (confname.c_str (), _dbmt_error)) | |
| { | |
| return build_server_header (response, ERR_FILE_OPEN_FAIL, _dbmt_error); | |
| } |
|
Reviews (55): Last reviewed commit: "[CBRD-26777[ fix error" | Re-trigger Greptile |
| </ItemDefinitionGroup> | ||
| <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | ||
| <Midl> | ||
| <TargetEnvironment>X64</TargetEnvironment> |
There was a problem hiding this comment.
Release|x64 빌드의 스택 버퍼 오버플로우 보호 비활성화
cub_manager.vcxproj의 Release|x64 구성에서 <BufferSecurityCheck>false</BufferSecurityCheck>로 설정되어 있어 MSVC의 /GS 스택 카나리 보호가 비활성화됩니다. 보안 강화를 목적으로 하는 이 PR에서 보안 핵심 바이너리의 스택 오버플로우 탐지를 꺼두는 것은 방향과 반대입니다. 참고로 동일 PR에서 추가된 cm_admin.vcxproj의 Release|x64는 <BufferSecurityCheck>true</BufferSecurityCheck>로 올바르게 설정되어 있습니다. cub_manager.vcxproj도 동일하게 true로 변경해야 합니다.
http://jira.cubrid.org/browse/CBRD-26777
Description
Implementattion
Remarks
KEYS for reviewers
Disussion point