fix: add missing "> /dev/" dangerous command check in s09/s10/s11

s09_agent_teams.py, s10_team_protocols.py, and s11_autonomous_agents.py
were missing the "> /dev/" entry in their dangerous command blocklist.
This is present in s01, s06, s12, and s_full but was dropped when s09-s11
were written, creating a security regression where commands like
`echo y > /dev/sda` could bypass the blocklist.
This commit is contained in:
123456wda
2026-05-15 10:56:15 +08:00
parent c354cf7721
commit 36c367429c
3 changed files with 3 additions and 3 deletions

View File

@@ -260,7 +260,7 @@ def _safe_path(p: str) -> Path:
def _run_bash(command: str) -> str: def _run_bash(command: str) -> str:
dangerous = ["rm -rf /", "sudo", "shutdown", "reboot"] dangerous = ["rm -rf /", "sudo", "shutdown", "reboot", "> /dev/"]
if any(d in command for d in dangerous): if any(d in command for d in dangerous):
return "Error: Dangerous command blocked" return "Error: Dangerous command blocked"
try: try:

View File

@@ -301,7 +301,7 @@ def _safe_path(p: str) -> Path:
def _run_bash(command: str) -> str: def _run_bash(command: str) -> str:
dangerous = ["rm -rf /", "sudo", "shutdown", "reboot"] dangerous = ["rm -rf /", "sudo", "shutdown", "reboot", "> /dev/"]
if any(d in command for d in dangerous): if any(d in command for d in dangerous):
return "Error: Dangerous command blocked" return "Error: Dangerous command blocked"
try: try:

View File

@@ -389,7 +389,7 @@ def _safe_path(p: str) -> Path:
def _run_bash(command: str) -> str: def _run_bash(command: str) -> str:
dangerous = ["rm -rf /", "sudo", "shutdown", "reboot"] dangerous = ["rm -rf /", "sudo", "shutdown", "reboot", "> /dev/"]
if any(d in command for d in dangerous): if any(d in command for d in dangerous):
return "Error: Dangerous command blocked" return "Error: Dangerous command blocked"
try: try: