mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🔒 Some security vulnerabilities https://github.com/siyuan-note/siyuan/issues/13426
This commit is contained in:
parent
2b5a9f9f1a
commit
e70ed57f6e
5 changed files with 28 additions and 1 deletions
|
|
@ -132,6 +132,11 @@ func Upload(c *gin.Context) {
|
|||
if nil != form.Value["assetsDirPath"] {
|
||||
relAssetsDirPath = form.Value["assetsDirPath"][0]
|
||||
assetsDirPath = filepath.Join(util.DataDir, relAssetsDirPath)
|
||||
if !util.IsAbsPathInWorkspace(assetsDirPath) {
|
||||
ret.Code = -1
|
||||
ret.Msg = "Path [" + assetsDirPath + "] is not in workspace"
|
||||
return
|
||||
}
|
||||
}
|
||||
if !gulu.File.IsExist(assetsDirPath) {
|
||||
if err = os.MkdirAll(assetsDirPath, 0755); err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue