🇰🇷 한글 설명
SiYuan의 Attribute View 이름이 HTML 이스케이프 없이 저장되어 WebSocket을 통해 모든 클라이언트에 전송됩니다. 렌더 템플릿이 이 값을 원본 문자열로 HTML에 삽입하고, 세 개의 독립적인 클라이언트 경로에서 이스케이프 없이 처리하면서 HTML injection이 발생합니다. Electron의 위험한 설정(nodeIntegration:true, contextIsolation:false, webSecurity:false)으로 인해 HTML injection이 Node.js 코드 실행으로 확대됩니다.
💡 쉬운 설명
SiYuan에서 악의적인 데이터베이스 이름을 만들면 다른 사용자의 컴퓨터에 악성 코드를 실행시킬 수 있습니다. Electron이 보안 설정이 매우 취약하게 되어 있어서 가능한 공격입니다.
🇺🇸 원문 (English)
SiYuan is an open-source personal knowledge management system. Prior to 3.7.0, the kernel stores Attribute View (AV / database) names without any HTML escape, then a render template uses raw strings.ReplaceAll(tpl, "${avName}", nodeAvName) to embed the name in HTML before pushing to all clients via WebSocket. Three independent client paths (render.ts:120 → outerHTML, Title.ts:401 → innerHTML, transaction.ts:559 → innerHTML) consume the value without escaping. Because the main BrowserWindow runs nodeIntegration:true, contextIsolation:false, webSecurity:false (app/electron/main.js:407-411), HTML injection in the renderer becomes Node.js code execution. This vulnerability is fixed in 3.7.0.
📍 영향받는 시스템
SiYuan 3.7.0 이전 버전
⚔️ 공격 벡터
Attribute View 이름에 HTML/JavaScript 코드를 주입하여 WebSocket 전송 시 원격 코드 실행 유도
🛡️ 대응 방법
SiYuan을 3.7.0 이상으로 업그레이드
🔧 검증 코드
출력된 버전이 3.7.0 이상이면 안전, 3.7.0 미만이면 취약, 'not installed'이면 설치 확인 필요
siyuan --version 2>/dev/null || echo "SiYuan not installed"