🇰🇷 한글 설명
SiYuan 3.7.0 이전 버전의 Bazaar 패키지 README 렌더링 과정에서 사용되는 lute 새니타이저의 이벤트 핸들러 차단 목록이 onpointerover, onpointerdown, onauxclick, onbeforetoggle, onfocusin, onanimationstart, ontransitionend 등 최신 이벤트 속성을 누락하고 있습니다. 이로 인해 악성 패키지 작성자가 관리자 세션에서 임의의 JavaScript를 실행할 수 있으며, 결과적으로 워크스페이스 전체에 대한 제어권을 얻을 수 있습니다.
💡 쉬운 설명
마켓플레이스의 악성 패키지 설명문에 숨겨진 코드가 관리자가 패키지를 열어볼 때 실행될 수 있습니다. 이를 통해 공격자가 관리자의 SiYuan 작업 공간을 장악할 수 있습니다.
🇺🇸 원문 (English)
SiYuan is an open-source personal knowledge management system. Prior to 3.7.0, renderPackageREADME in kernel/bazaar/readme.go renders a Bazaar package README from Markdown to HTML with the lute engine and SetSanitize(true). The lute sanitizer is an event-handler blocklist: allowAttr rejects only attribute names present in a fixed eventAttrs map copied from the w3schools legacy handler list. That map omits modern event handlers. onpointerover, onpointerdown, onauxclick, onbeforetoggle, onfocusin, onanimationstart, and ontransitionend are not in the list, so the sanitizer passes them through verbatim on any tag. The frontend assigns the rendered HTML to mdElement.innerHTML in app/src/config/bazaar.ts with no client-side DOMPurify on this path, into a normal element in the main document (no iframe, no sandbox). The kernel sends no Content-Security-Policy, X-Frame-Options, or X-Content-Type-Options header on any response, so an inline handler runs when its event fires. The README is rendered when an Administrator opens a package in Settings → Marketplace, after the one-time marketplace trust consent. Install is not required. Result: a third-party Bazaar package author runs JavaScript in the Administrator's authenticated SiYuan origin when the Administrator views and interacts with the package listing, and gains full control of the workspace. This vulnerability is fixed in 3.7.0.
📍 영향받는 시스템
SiYuan 3.7.0 미만 버전 (Bazaar 마켓플레이스 README 렌더링 기능 사용 환경)
⚔️ 공격 벡터
악성 Bazaar 패키지 작성자가 README에 최신 이벤트 핸들러가 포함된 HTML을 삽입하고, 관리자가 설정의 마켓플레이스에서 해당 패키지를 열거나 상호작용할 때 스크립트가 실행됨
🛡️ 대응 방법
SiYuan을 3.7.0 이상 버전으로 업데이트하고, 신뢰하지 않는 마켓플레이스 패키지를 확인 없이 열지 않도록 합니다.
🔧 검증 코드
출력된 버전이 3.7.0 미만이면 취약한 것이고, 3.7.0 이상이면 패치가 적용된 것입니다.
siyuan --version 2>/dev/null || grep -i '"version"' /Applications/SiYuan.app/Contents/Resources/app/package.json 2>/dev/null