Skip to content

Commit 0d25b50

Browse files
jyxjjjcodex
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 Co-authored-by: Codex <267193182+codex@users.noreply.github.com> Signed-off-by: jyxjjj <16695261+jyxjjj@users.noreply.github.com>
1 parent 5a5d8d6 commit 0d25b50

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)