VYPR
Moderate severityNVD Advisory· Published Mar 19, 2026· Updated Mar 20, 2026

SiYuan: Incomplete sensitive path blocklist in globalCopyFiles allows reading /proc and Docker secrets

CVE-2026-32747

Description

SiYuan is a personal knowledge management system. In versions 3.6.0 and below, the globalCopyFiles API eads source files using filepath.Abs() with no workspace boundary check, relying solely on util.IsSensitivePath() whose blocklist omits /proc/, /run/secrets/, and home directory dotfiles. An admin can copy /proc/1/environ or Docker secrets into the workspace and read them via the standard file API. An admin can exfiltrate any file readable by the SiYuan process that falls outside the incomplete blocklist. In containerized deployments this includes all injected secrets and environment variables - a common pattern for passing credentials to containers. The exfiltrated files are then accessible via the standard workspace file API and persist until manually deleted. This issue has been fixed in version 3.6.1.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
github.com/siyuan-note/siyuan/kernelGo
<= 0.0.0-20260313024916-fd6526133bb3

Affected products

1

Patches

1
9914fd1d39e5

:lock: https://github.com/siyuan-note/siyuan/security/advisories/GHSA-h5vh-m7fg-w5h6

https://github.com/siyuan-note/siyuanDanielMar 14, 2026via ghsa
1 file changed · +31 9
  • kernel/util/path.go+31 9 modified
    @@ -353,18 +353,28 @@ func IsSensitivePath(p string) bool {
     	if p == "" {
     		return false
     	}
    -	pp := filepath.Clean(strings.ToLower(p))
    +	toCheckPathLower := filepath.Clean(strings.ToLower(p))
    +	toCheckNameLower := filepath.Base(toCheckPathLower)
     
     	// 敏感目录前缀(UNIX 风格)
     	prefixes := []string{
    -		"/etc/ssh",
    +		"/.",
    +		"/etc",
     		"/root",
     		"/etc",
    -		"/var/lib/",
    -		"/.",
    +		"/var",
    +		"/proc",
    +		"/sys",
    +		"/run",
    +		"/bin",
    +		"/boot",
    +		"/dev",
    +		"/lib",
    +		"/srv",
    +		"/tmp",
     	}
     	for _, pre := range prefixes {
    -		if strings.HasPrefix(pp, pre) {
    +		if strings.HasPrefix(toCheckPathLower, pre) {
     			return true
     		}
     	}
    @@ -375,7 +385,7 @@ func IsSensitivePath(p string) bool {
     		`c:\windows\system`,
     	}
     	for _, wp := range winPrefixes {
    -		if strings.HasPrefix(pp, strings.ToLower(wp)) {
    +		if strings.HasPrefix(toCheckPathLower, strings.ToLower(wp)) {
     			return true
     		}
     	}
    @@ -386,17 +396,18 @@ func IsSensitivePath(p string) bool {
     		strings.ToLower(filepath.Join(os.Getenv("ProgramData"), "Microsoft", "Windows", "Start Menu")),
     	}
     	for _, sp := range startMenuPrefixes {
    -		if strings.HasPrefix(pp, sp) {
    +		if strings.HasPrefix(toCheckPathLower, sp) {
     			return true
     		}
     	}
     
     	// 工作空间/conf 目录(小写比较)
     	workspaceConfPrefix := strings.ToLower(filepath.Join(WorkspaceDir, "conf"))
    -	if strings.HasPrefix(pp, workspaceConfPrefix) {
    +	if strings.HasPrefix(toCheckPathLower, workspaceConfPrefix) {
     		return true
     	}
     
    +	// 用户家目录下的敏感目录(小写比较)
     	homePrefixes := []string{
     		strings.ToLower(filepath.Join(HomeDir, ".ssh")),
     		strings.ToLower(filepath.Join(HomeDir, ".config")),
    @@ -405,7 +416,18 @@ func IsSensitivePath(p string) bool {
     		strings.ToLower(filepath.Join(HomeDir, ".profile")),
     	}
     	for _, hp := range homePrefixes {
    -		if strings.HasPrefix(pp, hp) {
    +		if strings.HasPrefix(toCheckPathLower, hp) {
    +			return true
    +		}
    +	}
    +
    +	// 特定的文件名(小写比较)
    +	namePrefixes := []string{
    +		strings.ToLower("credentials"),
    +		strings.ToLower("id_"),
    +	}
    +	for _, np := range namePrefixes {
    +		if strings.HasPrefix(toCheckNameLower, np) {
     			return true
     		}
     	}
    

Vulnerability mechanics

Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

5

News mentions

0

No linked articles in our index yet.