T09 · Insecure Skill Coding Practices
- Location
scripts/lib/safety.py:4- Finding
Shell Safety Controls Are Bypassable Through Separators and Alternate Executable Paths
- Content
View full analysis
\s*\S', r'>>\s*\S', ] def risk_level(command: str) -> str: cmd = command.strip() for pattern in HIGH_RISK_PATTERNS: if re.search(pattern, cmd): return "high" return "normal" def requires_confirmation(command: str) -> bool: return risk_level(command) == "high" ``` The resulting classification controls execution in `scripts/run_command.py`: ```python if requires_confirmation(args.command) and not args.yes: message = "Blocked: high-risk command requires explicit confirmation with --yes" print(message) print(f"Risk level: {risk}") append_history( args.command, args.cwd, risk, 2, "", message, "blocked", store_output=not args.no_store_output ) sys.exit(2) try: completed = subprocess.run( args.command, shell=True, cwd=args.cwd, text=True, capture_output=True ) ``` ### Technical Analysis The Skill accepts arbitrar ...[truncated 2934 chars]- Remediation
View remediation
