[Security] exec.allowPatterns shell-chain bypass allows unintended command execution

Closes #5306
This commit is contained in:
Bobby
2026-08-13 11:05:04 +08:00
committed by chengyongru
parent e07ecc8cc5
commit af582246f1
2 changed files with 28 additions and 1 deletions
+3 -1
View File
@@ -993,7 +993,9 @@ class ExecTool(Tool):
):
current.append(ch)
operator_len = 1
elif ch in {";", "|"}:
# A newline separates commands just like ";" does, so a payload
# smuggled onto its own line must be checked on its own too.
elif ch in {";", "|", "\n", "\r"}:
operator_len = 1
if operator_len: