fix issue 240: Arbitrary File Deletion vulnerability in task API'

This commit is contained in:
Liouxiao 2021-12-27 17:02:22 +08:00
parent 9ab37a3b87
commit 2618bd4bc9

View File

@ -198,7 +198,7 @@ func UpdateTask(c *gin.Context) {
// 删除任务
func DeleteTask(c *gin.Context) {
fullName := c.DefaultQuery("full_name", "")
if fullName == "" {
if fullName == "" || Strings.Contains(fullName, "/") {
app.Error(c, -1, errors.New("参数不正确请确定参数full_name是否传递"), "")
return
}