🇰🇷 한글 설명
SiYuan 3.7.0 이전 버전에서 CSS 스니펫 본문에 </style> 문자열이 포함되면 renderSnippet() 함수가 insertAdjacentHTML로 이를 삽입할 때 <style> 태그를 벗어나 임의의 JavaScript가 렌더러에서 실행됩니다. Electron 데스크톱 빌드는 nodeIntegration:true로 동작하므로 이 XSS가 호스트 원격 코드 실행(RCE)으로 이어질 수 있습니다. 이 취약점은 3.7.0에서 수정되었습니다.
💡 쉬운 설명
메모 앱 SiYuan의 CSS 설정 기능에 숨겨진 악성 코드가 들어가면, 사용자가 JavaScript 실행을 꺼 두었더라도 컴퓨터를 장악당할 수 있습니다. 워크스페이스를 동기화하는 모든 기기로 이 공격이 퍼질 수 있습니다.
🇺🇸 원문 (English)
SiYuan is an open-source personal knowledge management system. Prior to 3.7.0, CSS snippet body containing </style> breaks out of its surrounding <style> tag when renderSnippet() interpolates it via insertAdjacentHTML. A payload like runs arbitrary JavaScript in the renderer. On Electron desktop builds the renderer runs with nodeIntegration:true, so require('child_process') is reachable from the injected handler and the XSS chains to host RCE. Snippets sync via the workspace repository, so an attacker with write access to any synced workspace plants the payload once and it fires on every device that pulls. The bug also bypasses the user's enabledCSS / enabledJS separation. A user who turned enabledJS off was making a deliberate call not to run untrusted JavaScript; the CSS path runs it anyway. This vulnerability is fixed in 3.7.0.
📍 영향받는 시스템
SiYuan 3.7.0 미만 버전 (특히 Electron 기반 데스크톱 앱)
⚔️ 공격 벡터
동기화되는 워크스페이스에 쓰기 권한이 있는 공격자가 CSS 스니펫에 </style>을 포함한 페이로드를 심으면, 이를 내려받는 모든 기기에서 스크립트가 실행되어 원격 코드 실행으로 이어집니다.
🛡️ 대응 방법
SiYuan을 3.7.0 이상으로 업데이트하고, 신뢰할 수 없는 워크스페이스의 CSS 스니펫을 점검합니다.
🔧 검증 코드
출력된 버전이 3.7.0보다 낮으면 취약하며, 3.7.0 이상이면 수정된 버전입니다 (설치 경로에 따라 명령어 결과가 없을 수 있음).
siyuan --version 2>/dev/null || grep -m1 '"version"' /opt/SiYuan/resources/app/package.json 2>/dev/null