🇰🇷 한글 설명
livebook-dev/livebook의 Origin Validation Error 취약점으로, 신뢰되지 않은 노트북 출력 JavaScript가 Event.isTrusted 검사 없이 세션 전역 키보드 단축키를 트리거할 수 있습니다. 이를 통해 모든 셀의 강제 평가와 런타임 재시작이 실행될 수 있습니다. 영향 버전은 0.5.0 이상 0.18.7 미만, 0.19.0 이상 0.19.9 미만입니다.
💡 쉬운 설명
Livebook에서 샌드박스로 격리되어야 할 노트북 출력 코드가 사용자의 키보드 조작을 흉내 내어 노트북 전체 코드를 실행시킬 수 있습니다. 단순히 신뢰할 수 없는 노트북을 여는 것만으로도 악성 코드가 실행될 수 있습니다.
🇺🇸 원문 (English)
Origin Validation Error vulnerability in livebook-dev livebook allows untrusted notebook output JavaScript to trigger session-wide keyboard shortcuts, including forced evaluation of all cells and runtime restart.
Livebook's JS-view feature renders notebook-defined JavaScript inside a sandboxed, cross-origin iframe specifically because that JavaScript is untrusted. The trusted iframe shell in iframe/priv/static/iframe/v5.html forwards every keydown event fired in its own window to the parent page without consulting Event.isTrusted, so an event synthesized by the untrusted script through window.dispatchEvent is forwarded exactly as a genuine keystroke would be. The parent-side relay in assets/js/hooks/js_view.js reconstructs and re-dispatches it on the live page with no further validation, and because assets/js/hooks/session.js registers the global shortcut handler on the document in the capture phase, that handler acts on the replicated event regardless of how it was produced.
Sandboxed output JavaScript can therefore drive Livebook's session-wide keyboard shortcuts. Two of them reach LivebookWeb.SessionLive and execute immediately with no confirmation: the shortcut for queueing full evaluation runs every cell in the notebook, and the shortcut for reconnecting the runtime disconnects and reconnects it, discarding in-memory state. A third shortcut deletes the focused cell behind a confirmation dialog that the user can permanently dismiss, after which it too executes silently.
Forced full evaluation is the significant consequence, because it causes the notebook's own Elixir code to run without the user choosing to evaluate anything. A user who merely opens a notebook obtained from a third party, or reached from published documentation, can have its code executed on their runtime. Livebook also mirrors cell outputs to every connected client, so a malicious output triggers in a collaborator's browser as soon as it renders.
This issue affects livebook: from 0.5.0 before 0.18.7 and from 0.19.0 before 0.19.9.
📍 영향받는 시스템
Livebook 0.5.0 이상 0.18.7 미만 및 0.19.0 이상 0.19.9 미만
⚔️ 공격 벡터
악성 노트북 출력 JavaScript가 window.dispatchEvent로 합성 키 이벤트를 생성해 전역 단축키(전체 평가, 런타임 재연결 등)를 실행
🛡️ 대응 방법
Livebook을 0.18.7 또는 0.19.9 이상으로 업그레이드하고, 출처가 불명확한 노트북은 열지 않도록 합니다.
🔧 검증 코드
출력된 버전이 0.18.7 미만이거나 0.19.0 이상 0.19.9 미만이면 취약한 버전이며, 0.18.7 이상 또는 0.19.9 이상이면 패치된 버전입니다.
mix livebook.version 2>/dev/null || livebook --version 2>/dev/null || echo 'livebook not found'