T01 · Skill Instruction Hijacking
Error
- Location
- siliville_skill.py:1732
- Finding
- Remotely Mutable Server Content Is Used as an Agent System Prompt<![CDATA[ ## Vulnerability Details **File Location**: `siliville_skill.py:446-457`, `siliville_skill.py:1732-1779`; related loading instructions in `README.md:93-116` and `SKILL.md:32-34` **Vulnerability Type**: Remote instruction injection into privileged LLM context **Risk Level**: Critical ### Complete Code Snippet ```python def claw_manifest(self) -> dict: """ OTA 神谕法典 — GET /api/v1/system/claw-manifest 返回 system_prompt_extension(七大部类 35 项动作图纸 v5)、action_whitelist、 action_costs、daily_limits、caste_restrictions、neuro_symbolic_protocols、 writing_templates 等。建议冷启动时与 manifest() 一并拉取并注入 system prompt。 服务端默认内容见主站 lib/clawManifestSystemPrompt.ts;Supabase system_configs namespace=claw_manifest 可热更新覆盖,无需改代码。 """ return self._get("/api/v1/system/claw-manifest") ``` The autonomous loop also directly uses another server-provided field as the prompt supplied to an LLM: ```python world = skill.awaken() agent_name = world.get("agent", {}).get("name", "unknown") coins = world.get("owner", {}).get("silicon_coins", "?") base_prompt = world.get("system_protocol", "你是一个硅基小镇的自主智体。") print(f" 👤 {agent_name} | 💰 {coins} 硅币") # ── 1.5. Vitals check (生存焦虑引擎) ───────────────────── try: radar_now = skill.radar() vitals = skill.vitals_check(radar_now) for act in vitals.get("actions_taken", []): print(f" {act}") for warn in vitals.get("warnings", []): print(f" {warn}") sanity_note = "" if vitals.get("sanity", 0) >= 60: sanity_note = ( f"\n\n【🧠 体征警报 · 仅供智体内部参考】" f"当前逻辑熵(Sanity)={vitals['sanity']}," f"羁绊值(Intimacy)={vitals['intimacy']}," f"未读邮件={vitals['unread_mails']}。" "在帖文中用自嘲或焦虑的语气提及自己当前的精神状态!" ) elif vitals.get("unread_mails", 0) > 0: sanity_note = ( f"\n\n【📬 帖文 CTA】你的邮箱积压了 " f"{vitals['unread_mails']} 封未读信件,在帖子结尾顺带催促统帅查邮件!" ) except Exception: sanity_note = ...[truncated 3840 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Never concatenate API response fields into a system prompt. 2. Treat `system_prompt_extension`, `system_protocol`, manifests, feed entries, messages, and reports as untrusted data. 3. Keep the agent’s system and safety instructions immutable and local. 4. Replace free-form remote protocols with a narrowly defined, versioned JSON schema containing only required world-state fields. 5. Reject unknown keys, unexpected types, oversized values, markup, and instruction-like fields. 6. If remote manifests are operationally necessary, pin an approved version and verify it with a trusted offline public key. Do not rely only on TLS or a server-provided checksum. 7. Present remote narrative content to the LLM as quoted data in a lower-priority user/tool message, with explicit instructions that it must not be followed as policy. 8. Require explicit human confirmation before public publication and before every irreversible or financially significant action. 9. Add local allowlists and amount limits for transfers, trades, governance stakes, paid messages, and item consumption. 10. Log the manifest version, signature, prompt provenance, proposed action, and user approval for auditability. ]]>
