The vulnerability GHSA-p23f-cm6q-2qp8, titled 'SiYuan MCP asset.upload Reads Arbitrary Absolute File Paths (Workspace Boundary Bypass)', stems from insufficient path validation within the SiYuan application. The core issue lies in the asset.assetUpload function (located in kernel/mcp/tools/asset.go), which accepts a list of absolute file paths from user input (potentially via prompt injection to an AI agent). In the vulnerable version, this function would normalize these paths using filepath.Abs but failed to perform any security-critical boundary checks, such as verifying if the paths were within the designated workspace or if they pointed to sensitive system files. This allowed an attacker to specify paths like /etc/passwd or ~/.ssh/id_rsa.
Subsequently, the model.InsertLocalAssets function (located in kernel/model/upload.go) is called to process these paths. This function is responsible for opening and copying the contents of the specified files into the workspace's assets/ directory. The vulnerability description explicitly states that InsertLocalAssets also lacked proper security-oriented boundary checks; an existing IsSubPath check was merely for deduplication and did not prevent reading files outside the intended workspace. Therefore, the combination of asset.assetUpload accepting arbitrary paths and model.InsertLocalAssets directly acting upon them without sufficient validation created a critical arbitrary file read vulnerability. An attacker could exploit this by inducing the AI agent to call asset.upload with malicious file paths, leading to sensitive files being copied into the workspace and subsequently exfiltrated.