T05 · Unauthorized Access and Privilege Escalation
- Location
main.py:960- Finding
Unauthenticated Webhook Enables Arbitrary OpenClaw CLI Invocation
- Content
View full analysis
dict: sid = safe_session_id(session_id) parts = command_text[1:].strip().split() if command_text.startswith("/") else command_text.strip().split() if not parts: return {"ok": False, "reply": "❌ 空命令"} cmd = [self.bin] + parts logger.info("🛠️ [OpenClaw CMD] sid=%s | %s", sid, " ".join(cmd)) try: res = self._run_subprocess(cmd, self.cmd_timeout) ``` ```python if text.strip().startswith("/"): result = adapter.command(session_id, text.strip()) if not result.get("ok", False): logger.error("❌ OpenClaw 命令失败 sid=%s | err=%s", session_id, result.get("reply", "")) reply_text(to_wxid, "⚠️ 命令执行失败,请稍后重试。", config) return ``` ```python @app.post("/wechat/callback") async def handle_wechat(request: Request): try: config = load_config() body = await request.body() logger.info("📦 原始回调: %s", body.decode("utf-8", errors="ignore")) data = json.loads(body) parsed = parse_wechat_payload(data) ``` ### Technical Analysis The publicly exposed callback does not verify a signature, shared secret, timestamp, nonce, source address, or any other proof that a request originated from the legitimate WeChat API provider. Identity fields such as the sender and chat ID are trusted directly from the request body. Messages beginning with `/` are split into arguments and appended to the configured OpenC ...[truncated 1728 chars]- Remediation
View remediation
