Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:lock: https://github.com/siyuan-note/siyuan/security/advisories/GHSA-hhgj-gg9h-rjp7

Daniel009bb598b3be
diff --git a/kernel/server/serve.go b/kernel/server/serve.go
index aedc7c0380..067637e257 100644
--- a/kernel/server/serve.go
+++ b/kernel/server/serve.go
@@ -444,6 +444,11 @@ func serveAppearance(ginServer *gin.Engine) {
}
siyuan.GET("/appearance/*filepath", func(c *gin.Context) {
filePath := filepath.Join(appearancePath, strings.TrimPrefix(c.Request.URL.Path, "/appearance/"))
+ if !util.IsSubPath(appearancePath, filePath) {
+ c.Status(http.StatusUnauthorized)
+ return
+ }
+
if strings.HasSuffix(c.Request.URL.Path, "/theme.js") {
if !gulu.File.IsExist(filePath) {
// 主题 js 不存在时生成空内容返回