🇰🇷 한글 설명
jupyter/nbconvert 7.17.0 이하 버전에서 HTML 내보내기 시 text/vnd.mermaid 출력이 이스케이프 없이 렌더링되어 크로스사이트 스크립팅(XSS)이 발생합니다. 공격자는 <pre> 태그를 빠져나오는 방식으로 임의의 HTML/JavaScript를 삽입할 수 있습니다.
💡 쉬운 설명
노트북을 HTML 파일로 변환하는 도구에 취약점이 있어, 악성 코드가 숨겨진 노트북을 보면 공격자가 심어둔 스크립트가 실행될 수 있습니다. 이를 통해 사용자의 세션 정보나 화면 조작 등의 피해가 발생할 수 있습니다.
🇺🇸 원문 (English)
A vulnerability in jupyter/nbconvert versions <= 7.17.0 allows for Cross-site Scripting (XSS) via unsanitized `text/vnd.mermaid` output in HTML exports. The `data_mermaid` block in `share/templates/lab/base.html.j2` renders `text/vnd.mermaid` cell output directly into HTML without escaping, enabling attackers to inject arbitrary HTML/JavaScript by breaking out of the `<pre>` tag. This vulnerability impacts any server using nbconvert to render notebooks as HTML, allowing attackers to execute arbitrary JavaScript in the context of users viewing the HTML export.
📍 영향받는 시스템
jupyter nbconvert 7.17.0 이하 버전을 사용해 노트북을 HTML로 렌더링하는 모든 서버 및 환경
⚔️ 공격 벡터
악성 text/vnd.mermaid 출력이 포함된 노트북을 HTML로 내보내 피해자가 열람하도록 유도하여 임의 스크립트 실행
🛡️ 대응 방법
nbconvert를 7.17.0보다 높은 패치 버전으로 업그레이드 (pip install -U nbconvert)
🔧 검증 코드
출력된 버전이 7.17.0 이하이면 취약하므로 패치 버전으로 업그레이드가 필요하며, 7.17.0을 초과하면 조치된 상태입니다.
pip show nbconvert 2>/dev/null | grep -i '^version'