Skip to content

Commit

Permalink
fix: 解决命令注入waf被绕过的问题 (#4131)
Browse files Browse the repository at this point in the history
  • Loading branch information
L1nyz-tel authored Mar 8, 2024
1 parent 2687c91 commit ba63907
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backend/utils/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ func CheckIllegal(args ...string) bool {
for _, arg := range args {
if strings.Contains(arg, "&") || strings.Contains(arg, "|") || strings.Contains(arg, ";") ||
strings.Contains(arg, "$") || strings.Contains(arg, "'") || strings.Contains(arg, "`") ||
strings.Contains(arg, "(") || strings.Contains(arg, ")") || strings.Contains(arg, "\"") {
strings.Contains(arg, "(") || strings.Contains(arg, ")") || strings.Contains(arg, "\"") ||
strings.Contains(arg, "\n") || strings.Contains(arg, "\r") {
return true
}
}
Expand Down

0 comments on commit ba63907

Please sign in to comment.