mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-19 14:56:09 +01:00
🔒 Arbitrary file reading vulnerability https://github.com/siyuan-note/siyuan/issues/16860
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
f922745aa7
commit
b2274baba2
3 changed files with 118 additions and 3 deletions
|
|
@ -248,7 +248,18 @@ func netAssets2LocalAssets0(tree *parse.Tree, onlyImg bool, originalURL string,
|
|||
u = u[:strings.Index(u, "?")]
|
||||
}
|
||||
|
||||
if !gulu.File.IsExist(u) || gulu.File.IsDir(u) {
|
||||
if !gulu.File.IsExist(u) {
|
||||
logging.LogErrorf("local file asset [%s] not exist", u)
|
||||
continue
|
||||
}
|
||||
|
||||
if gulu.File.IsDir(u) {
|
||||
logging.LogWarnf("ignore converting directory path [%s] to local asset", u)
|
||||
continue
|
||||
}
|
||||
|
||||
if util.IsSensitivePath(u) {
|
||||
logging.LogWarnf("ignore converting sensitive path [%s] to local asset", u)
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue