Skip to content

Commit 651da18

Browse files
jyxjjjxrgzs
andcommitted
fix(handles): add src_name validation in FsBatchRename
- Validate source names with checkRelativePath before batch renames - Reject invalid source paths with a forbidden response Signed-off-by: MadDogOwner <xiaoran@xrgzs.top> Co-authored-by: MadDogOwner <xiaoran@xrgzs.top>
1 parent 5a5d8d6 commit 651da18

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

server/handles/fsbatch.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,11 @@ func FsBatchRename(c *gin.Context) {
188188
if renameObject.SrcName == "" || renameObject.NewName == "" {
189189
continue
190190
}
191+
err = checkRelativePath(renameObject.SrcName)
192+
if err != nil {
193+
common.ErrorResp(c, err, 403)
194+
return
195+
}
191196
err = checkRelativePath(renameObject.NewName)
192197
if err != nil {
193198
common.ErrorResp(c, err, 403)

0 commit comments

Comments
 (0)