An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:lock: Fix https://github.com/siyuan-note/siyuan/security/advisories/GHSA-c4jr-5q7w-f6r9
Danield7f790755edf
diff --git a/kernel/api/file.go b/kernel/api/file.goindex 307ae38cb8..b0890313bc 100644--- a/kernel/api/file.go+++ b/kernel/api/file.go@@ -141,6 +141,14 @@ func copyFile(c *gin.Context) {}dest := arg["dest"].(string)+ if util.IsSensitivePath(dest) {+ msg := fmt.Sprintf("refuse to copy sensitive file [%s]", dest)+ logging.LogErrorf(msg)+ ret.Code = -2+ ret.Msg = msg+ return+ }+if err = filelock.Copy(src, dest); err != nil {logging.LogErrorf("copy file [%s] to [%s] failed: %s", src, dest, err)ret.Code = -1diff --git a/kernel/util/path.go b/kernel/util/path.goindex 6fae2db3a4..7cf834497b 100644--- a/kernel/util/path.go+++ b/kernel/util/path.go@@ -373,6 +373,7 @@ func IsSensitivePath(p string) bool {"/etc/ssh","/root","/etc/ssl",+ "/etc/cron.d/","/etc/letsencrypt","/var/lib/docker","/.gnupg",@@ -404,6 +405,7 @@ func IsSensitivePath(p string) bool {base := filepath.Base(pp)n := strings.ToLower(base)sensitiveNames := map[string]struct{}{+ ".bashrc": {},".env": {},".env.local": {},".npmrc": {},