mirror of
https://github.com/shareAI-lab/analysis_claude_code.git
synced 2026-08-06 03:53:37 +08:00
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:
@@ -260,7 +260,7 @@ def _safe_path(p: str) -> Path:
|
||||
|
||||
|
||||
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):
|
||||
return "Error: Dangerous command blocked"
|
||||
try:
|
||||
|
||||
@@ -301,7 +301,7 @@ def _safe_path(p: str) -> Path:
|
||||
|
||||
|
||||
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):
|
||||
return "Error: Dangerous command blocked"
|
||||
try:
|
||||
|
||||
@@ -389,7 +389,7 @@ def _safe_path(p: str) -> Path:
|
||||
|
||||
|
||||
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):
|
||||
return "Error: Dangerous command blocked"
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user