🇰🇷 한글 설명
Vim의 netrw 플러그인에서 디렉토리 경로를 히스토리 파일로 직렬화할 때 발생하는 Vimscript 코드 주입 취약점입니다. 파일 시스템에서 가져온 디렉토리 이름에 포함된 작은따옴표가 적절히 이스케이프되지 않아, 악의적으로 조작된 디렉토리 이름이 실행될 경우 임의의 Vimscript나 셸 명령어가 실행될 수 있습니다.
💡 쉬운 설명
특이한 이름의 폴더를 열었을 때, 그 이름에 숨겨진 악성 명령어가 컴퓨터에서 자동으로 실행될 수 있는 보안 약점입니다. 공격자가 만든 폴더 이름만으로도 해커가 사용자의 컴퓨터를 조종할 위험이 있습니다.
🇺🇸 원문 (English)
Vim is an open source, command line text editor. Prior to version 9.2.0495, a Vimscript code injection vulnerability exists in s:NetrwBookHistSave() in the netrw plugin (runtime/pack/dist/opt/netrw/autoload/netrw.vim) when serializing browsed directory paths to the history file ~/.vim/.netrwhist. A directory name derived from the filesystem is interpolated into a single-quoted Vimscript string literal without escaping embedded single quotes, allowing a crafted directory name to break out of the string context and execute arbitrary Vimscript, including shell commands via system() and :!, the next time the history file is sourced. This issue has been patched in version 9.2.0495.
📍 영향받는 시스템
Vim 9.2.0495 미만 버전 (netrw 플러그인 포함)
⚔️ 공격 벡터
악의적으로 조작된 이름의 디렉토리를 생성하고 Vim으로 해당 경로를 탐색하여 히스토리 파일에 기록되게 함
🛡️ 대응 방법
Vim을 최신 버전인 9.2.0495 이상으로 업데이트하십시오.
🔧 검증 코드
출력된 버전 번호가 9.2.0495보다 낮으면 취약한 상태입니다.
vim --version | head -n 1 | grep -oE 'VIM ([0-9\.]+)' | awk '{print $2}'