🇰🇷 한글 설명
Electron 프레임워크의 WebCodecs API VideoFrame 객체가 contextBridge를 통해 전달될 때 컨텍스트 격리(context isolation) 우회 취약점이 발생합니다. XSS를 통해 메인 월드에서 JavaScript를 실행한 공격자는 격리된 월드의 Node.js API에 접근할 수 있습니다. preload 스크립트가 VideoFrame을 exposeInMainWorld()로 노출하는 앱만 영향을 받습니다.
💡 쉬운 설명
Electron 앱에서 특정 방식으로 동영상 데이터를 처리할 때, 웹 페이지의 악의적 코드가 시스템 권한이 있는 영역에 접근할 수 있게 됩니다. 이는 앱이 특정 기능을 특정 방식으로 노출했을 때만 발생합니다.
🇺🇸 원문 (English)
Electron is a framework for writing cross-platform desktop applications using JavaScript, HTML and CSS. From versions 39.0.0-alpha.1 to before 39.8.0, 40.0.0-alpha.1 to before 40.7.0, and 41.0.0-alpha.1 to before 41.0.0-beta.8, apps that pass VideoFrame objects (from the WebCodecs API) across the contextBridge are vulnerable to a context isolation bypass. An attacker who can execute JavaScript in the main world (for example, via XSS) can use a bridged VideoFrame to gain access to the isolated world, including any Node.js APIs exposed to the preload script. Apps are only affected if a preload script returns, resolves, or passes a VideoFrame object to the main world via contextBridge.exposeInMainWorld(). Apps that do not bridge VideoFrame objects are not affected. This issue has been patched in versions 39.8.0, 40.7.0, and 41.0.0-beta.8.
📍 영향받는 시스템
Electron 39.0.0-alpha.1~39.8.0 미만, 40.0.0-alpha.1~40.7.0 미만, 41.0.0-alpha.1~41.0.0-beta.8 미만
⚔️ 공격 벡터
XSS를 통해 메인 월드에 JavaScript를 주입한 후, contextBridge로 노출된 VideoFrame 객체를 이용하여 격리된 컨텍스트의 Node.js API 접근
🛡️ 대응 방법
Electron을 39.8.0, 40.7.0, 41.0.0-beta.8 이상으로 업그레이드하거나, preload 스크립트에서 VideoFrame 객체를 main world로 반환하지 않기
🔧 검증 코드
명령어 실과 결과에서 electron 버전 확인 후, 39.8.0 미만, 40.0.0~40.7.0 미만, 41.0.0-beta.8 미만인지 확인하여 취약점 여부 판단
npm ls electron 2>/dev/null | grep electron | head -1