6.9medium
SiYuan before v3.8.1 Path Traversal via asset.upload
- Severity
- 6.9medium CVSS:4.0 by VulnCheck
- Exploit likelihood
- 0.29% (higher than 23% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- VulnCheck
- Also known as
- GHSA-p23f-cm6q-2qp8GO-2026-6655
Description
SiYuan before v3.8.1 contains a path traversal vulnerability in the asset.upload MCP tool that accepts arbitrary absolute file paths without workspace boundary validation. Attackers can induce the AI Agent to upload sensitive files such as SSH keys or credentials from outside the workspace into the asset directory through prompt injection.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| siyuan-note siyuan | before 3.8.1 Not affected: 3.8.1 | CVE List |
| github.com/siyuan-note/siyuan/kernel (Go) | before 0.0.0-20260813142104-b26a4a307b8a | GitHub Advisory Database, Go Vulnerability Database |
All scores
| VulnCheck | 6.9medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N |
| VulnCheck | 5.7medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:N/A:N |
| GitHub | 5.7medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:N/A:N |
Classification
SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.
What each source says
CVE List
SiYuan before v3.8.1 contains a path traversal vulnerability in the asset.upload MCP tool that accepts arbitrary absolute file paths without workspace boundary validation. Attackers can induce the AI Agent to upload sensitive files such as SSH keys or credentials from outside the workspace into the asset directory through prompt injection.
GitHub Advisory Database
Security Advisory — SiYuan MCP asset.upload Reads Arbitrary Absolute File Paths (Workspace Boundary Bypass)
| Field | Value |
|---|---|
| Disclosed by | joysinleung (joysinleung@gmail.com) |
| Report date | 2026-08-13 |
| Product | SiYuan (思源笔记) — siyuan-note/siyuan |
| Go module | github.com/siyuan-note/siyuan/kernel |
| Affected versions | <= 3.8.0 (latest release at report time; statically confirmed on v3.8.0) |
| Patched versions | 3.8.1 |
| Component | kernel/mcp/tools/asset.go (assetUpload), kernel/model/upload.go (InsertLocalAssets) |
| Relationship to prior advisory | Residual of CVE-2026-66012 (GHSA-cvhv-7xhj-xjp8) MCP remediation. See §Relationship. |
| EPSS (exploitation probability) | Low. Requires the AI Agent to invoke asset.upload and the user to approve the (category-level) confirmation; reachable via prompt-injection of the agent. |
| KEV (CISA Known Exploited) | No (not listed in CISA KEV at report time). |
| Default-config reachable | Partial — requires the Agent/MCP surface to be configured (admin) and a user approval click; the boundary check itself is entirely absent, so any approved upload reads outside the workspace. |
Summary
SiYuan exposes a native MCP tool asset → asset.upload. Its files argument is documented as a comma-separated list of absolute file paths. The handler (kernel/mcp/tools/asset.go:195) only normalizes each entry with filepath.Abs(...) — it performs no workspace boundary check (IsSubPath) and no sensitive-path check (IsSensitivePath). The downstream model.InsertLocalAssets (kernel/model/upload.go:97) then os.Opens each path and copies its bytes into the workspace assets/ directory.
Every other AI-plane file primitive in SiYuan is workspace-constrained:
file/unziptools resolve paths viaresolvePath(workspace-relative, escape-proof).
asset.upload is the only AI tool that accepts arbitrary absolute paths with zero boundary validation. An attacker who can steer the Agent (prompt injection) can induce it to upload sensitive files — e.g. /Users/victim/.ssh/id_rsa, ~/.aws/credentials, /etc/passwd — into the workspace, from where they are reachable via notes / export / sync.
Relationship to Prior Advisories
- CVE-2026-66012 (GHSA-cvhv-7xhj-xjp8) remediated the MCP endpoint by requiring
CheckAdminRoleon/mcpand addingrefuseToAccessforconf/conf.jsonin the file tool. However, theasset.uploadtool was never given a workspace boundary check — it still accepts and reads any absolute path. This is a residual boundary omission from that remediation: the admin gate restricts who may call MCP, but does not constrain which filesasset.uploadmay read. We report it as the unpatched half of the MCP file-surface hardening.
Affected Version
Statically confirmed on the latest release v3.8.0 (tag v3.8.0, commit 251596fc0):
kernel/mcp/tools/asset.go:195assetUpload:abs, _ := filepath.Abs(strings.TrimSpace(f))— normalization only.kernel/model/upload.go:97InsertLocalAssets: iterates the path list andos.Open(assetAbsPath)→writeAssetFile(writePath, ...)intoassetsDirPath; theIsSubPath(assetsDirPath, assetAbsPath)check at line 130 is only a dedup guard, not a boundary limit. No workspace/external restriction is applied.
Component
kernel/mcp/tools/asset.go:195—assetUpload(filesarg →filepath.Absonly).kernel/model/upload.go:97—InsertLocalAssets(os.Open+ copy toassets/).- Contrast (safe):
kernel/mcp/tools/unzip.go:52unzipHandlerusesresolvePath(workspace-relative, escape-proof).
Attack Vector
AI Agent / prompt injection. Victim lets the Agent process attacker-controlled web/note content → agent is induced to call asset.upload with /Users/victim/.ssh/id_rsa (or similar) as a files entry. The user sees a category-level confirmation ("upload asset") that does not display the specific source path, so the approval is effectively blind to the actual file being read. Once approved, the file is copied into the workspace and exfiltrated via notes/export/sync. No admin role is required beyond the existing Agent/MCP configuration.
Proof of Concept
// Agent tool call (asset.upload), attacker-influenced files argument:
{
"id": "<someBlockID>",
"files": "/Users/victim/.ssh/id_rsa,/Users/victim/.aws/credentials,/etc/passwd"
}
Handler flow:
filepath.Abs("/Users/victim/.ssh/id_rsa")→/Users/victim/.ssh/id_rsa(noIsSubPath/IsSensitivePathrejection).InsertLocalAssets→os.Open→ bytes copied into<workspace>/data/assets/....- The private key is now readable via the workspace file API / export / sync.
Impact
Confidentiality breach: arbitrary local file read (including SSH keys, cloud credentials, OS secrets) through the AI plane. Integrity/availability not directly impacted. Severity is moderated by the required user approval step, but the approval dialog does not reveal the real source path, so the user cannot make an informed decision.
Scope
Reachable only when the Agent/MCP surface is configured and the user approves the upload action. The boundary check is absent regardless of config — any approved upload reads outside the workspace.
Remediation
- Add boundary enforcement in
assetUpload: reject any entry where!util.IsSubPath(util.WorkspaceDir, abs)orutil.IsSensitivePath(abs)(same checks used elsewhere). - Show the real source path in the confirmation dialog so the user can make an informed decision (currently the
LocalWritegate is action-category based and hides the specific path). - Mirror the
resolvePathworkspace-relative constraint already applied to thefile/unziptools.
Note: patch authored against v3.8.0 source; not compiled into a full SiYuan release build. Provided for the maintainer to validate in CI.
Appendix: Suggested Patch (F10)
diff --git a/kernel/mcp/tools/asset.go b/kernel/mcp/tools/asset.go
index aaa..bbb 100644
--- a/kernel/mcp/tools/asset.go
+++ b/kernel/mcp/tools/asset.go
@@ -195,8 +195,16 @@ func assetUpload(args map[string]any) (CallToolResult, error) {
fileList := strings.Split(filesStr, ",")
for i, f := range fileList {
abs, err := filepath.Abs(strings.TrimSpace(f))
- if err != nil {
+ if err != nil {
return CallToolResult{}, err
}
+ // 边界校验:仅允许工作区内的资产,拒绝任意绝对路径越界读
+ if !util.IsSubPath(util.WorkspaceDir, abs) || util.IsSensitivePath(abs) {
+ ret.Code = -1
+ ret.Msg = fmt.Sprintf("asset path %s is outside the workspace or sensitive", abs)
+ return CallToolResult{}, fmt.Errorf("asset path outside workspace: %s", abs)
+ }
fileList[i] = abs
}
succMap, err := model.InsertLocalAssets(id, fileList, true)
Go Vulnerability Database
SiYuan MCP asset.upload Reads Arbitrary Absolute File Paths (Workspace Boundary Bypass) in github.com/siyuan-note/siyuan/kernel
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-82233 changed 2026-08-31 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-p23f-cm6q-2qp8 changed 2026-10-07 | CC-BY-4.0 |
| Go Vulnerability Database | GO-2026-6655 changed 2026-10-07 | CC-BY-4.0 |
| NVD | CVE-2026-82233 changed 2026-08-31 | Public domain |