Merge pull request #286 from 123456wda/fix/s09-s10-s11-missing-dev-null-check

fix: add missing "> /dev/" dangerous command check in s09/s10/s11
This commit is contained in:
Yang Haoran
2026-06-27 01:28:25 +08:00
committed by GitHub
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: