1nwf / Produx-v2

Poor file permissions used when creating a directory GSC-G301
Security
Major
8 months ago2 years old
Expect directory permissions to be 0750 or less
33		if err != nil {
34			break
35		} else if i == 1 {
36			os.Mkdir("./public/"+userInfo.Name+"/"+product.Name, 0755)37		}
38		imgUrl := fmt.Sprintf("./public/%s/%s/%s", userInfo.Name, product.Name, file.Filename)
39
Expect directory permissions to be 0750 or less
37		return c.Status(400).JSON(fiber.Map{"error": err.Error()})
38	}
39  postId := uuid.NewString()
40  err := os.Mkdir("./public/"+userInfo.Name+"/"+postId, 0755) 41  if err != nil{
42    return c.SendStatus(fiber.StatusInternalServerError)
43  }