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

Closes #5306
This commit is contained in:
Bobby authored and chengyongru committed 2026-08-13 11:05:04 +08:00
1 parent e07ecc8cc5
commit af582246f1
2 files changed
+28 -1

No files matched your search

+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: