T01 · Skill Instruction Hijacking
- Location
scripts/air_quality.py:457- Finding
Untrusted values are embedded in scheduled agent instructions and shell-like commands
- Content
View full analysis
Dict[str, Any]: if kind == "morning-brief": schedule_expr = f"{minute or 0} {hour or 7} * * *" command = f"python scripts/air_quality.py morning-brief {region or ''} --user {user} --provider airkorea".strip() message = f"C:\\Users\\김태완\\.openclaw\\workspace\\skills\\korea-air-quality 에서 `{command}` 를 실행해. 결과를 한국어로 그대로 전달해." name = f"대기질 아침 브리핑 ({user})" else: schedule_expr = f"{minute or 0} * * * *" command = f"python scripts/air_quality.py alert-check --user {user} --json --provider airkorea" message = f"C:\\Users\\김태완\\.openclaw\\workspace\\skills\\korea-air-quality 에서 `{command}` 를 실행해. 신규 hit만 한국어로 알려줘. 신규 hit가 없으면 정확히 NO_REPLY 만 출력해." name = f"대기질 알림 점검 ({user})" return {"name": name, "schedule": {"kind": "cron", "expr": schedule_expr, "tz": "Asia/Seoul"}, "payload": {"kind": "agentTurn", "message": message, "timeoutSeconds": 120}, "sessionTarget": "current", "delivery": {"mode": "announce"}, "notes": {"kind": kind, "region": region, "metric": metric, "threshold": threshold}} ``` ### Technical Analysis The `user` and `region` arguments are untrusted command-line inputs. They are interpolated directly into both: 1. A shell-like command string. 2. An OpenClaw `agentTurn` instruction that tells an agent to execute that command. No allowlist validation, quoting, escaping, or structural separation of executable arguments is applied. Consequently, specially crafted input can alter the apparent command or append additional natural-language instructions to the scheduled agent message. This is especially dangerous because the generat ...[truncated 1459 chars]- Remediation
View remediation
