T09 · Insecure Skill Coding Practices
- Location
scripts/router.py:85- Finding
Shell Command Injection in Telegram, A2A, and Email Delivery
- Content
View full analysis
Optional[str]: """Deliver via OpenClaw message tool (shell out to openclaw CLI).""" target = spec.target_id or spec.to try: cmd = f'openclaw message send --to "{target}" --message "{message[:4000]}"' result = subprocess.run(cmd, shell=True, capture_output=True, text=True, timeout=30) if result.returncode != 0: return f"Telegram delivery failed: {result.stderr[:200]}" return None except Exception as e: return f"Telegram delivery error: {e}" ``` ```python def _deliver_a2a(self, spec: RoutingSpec, message: str) -> Optional[str]: """Send via A2A (shell out).""" agent = spec.target_id or spec.to try: cmd = f'openclaw a2a send --to "{agent}" --message "{message[:2000]}"' result = subprocess.run(cmd, shell=True, capture_output=True, text=True, timeout=30) if result.returncode != 0: return f"A2A delivery failed: {result.stderr[:200]}" return None except Exception as e: return f"A2A delivery error: {e}" ``` ```python def _deliver_email(self, spec: RoutingSpec, severity: str, summary: str, body: str) -> Optional[str]: """Send email via gog CLI.""" to_addr = spec.target_id if not to_addr: return "Email: no target_id (address) specified" try: subject = f"[Dial-a-Cron] [{severity.upper()}] {self.job_id}" full_body = f"{summary}\n\n{body[:4000]}" if body != summary else summary cmd = f'gog gmail send --to "{to_addr}" --subject "{subject}" --body "{full_body[:4000]}"' result = subprocess.run(cmd, shell=True, capture_output=True, text=True, timeout=30) if result.return ...[truncated 2135 chars]- Remediation
View remediation
