🇰🇷 한글 설명
Markdown Preview Enhanced 확장 프로그램 0.8.30 미만 버전에서 웹뷰 메시지 핸들러가 공격자가 제어하는 명령과 인자를 검증 없이 실행하는 취약점이 발견되었습니다. 이를 통해 공격자는 권한이 필요한 확장 프로그램 명령을 호출하여 파일을 수정하거나 코드를 실행하는 등의 행위를 할 수 있습니다. 이 문제는 0.8.30 버전에서 수정되었습니다.
💡 쉬운 설명
마크다운 미리보기 도구의 보안 허점을 이용해 해커가 사용자의 컴퓨터에서 몰래 파일을 바꾸거나 명령을 실행할 수 있는 문제입니다. 미리보기 화면에서 악성 코드가 실행될 경우 확장 프로그램의 높은 권한을 악용할 수 있습니다.
🇺🇸 원문 (English)
Markdown Preview Enhanced is a Markdown preview extension for Visual Studio Code. Prior to 0.8.30, the webview message handler in src/preview-provider.ts accepts an attacker-controlled command value and attacker-controlled args, constructs a command in the _crossnote namespace, and invokes vscode.commands.executeCommand without an allowlist or type validation. JavaScript already executing in the preview webview can use this bridge to invoke privileged extension commands, including file modification, code-chunk execution, export-tool execution, and arbitrary URL opening, with attacker-selected arguments. Exploitation requires a separate webview JavaScript execution path, such as the independently tracked .crossnote/head.html injection, but no further authorization check protects the extension-host command boundary. This issue is fixed in version 0.8.30.
📍 영향받는 시스템
Markdown Preview Enhanced (Visual Studio Code extension) version < 0.8.30
⚔️ 공격 벡터
웹뷰 내 자바스크립트 실행을 통해 검증되지 않은 명령을 확장 프로그램 호스트로 전달하여 실행
🛡️ 대응 방법
Markdown Preview Enhanced 확장 프로그램을 0.8.30 버전 이상으로 업데이트
🔧 검증 코드
출력된 버전 번호가 0.8.30 미만인지 확인하여 취약 여부를 판단합니다.
code --list-extensions | grep markdown-preview-enhanced && code --list-extensions | grep markdown-preview-enhanced | xargs -I {} code --extension-version {} 2>/dev/null