Back to skill

Security audit

feishu-routing

Security checks for vulnerabilities and agentic risk

Overview

This skill is a Feishu chat router, but it automatically sends group messages to sub-agents and forwards replies without clear safeguards against malicious or sensitive chat content.

Review this before installing in any real Feishu workspace. It should be limited to intended groups and least-privilege sub-agents, and the router should treat group messages as untrusted data, validate senders, redact sensitive content where possible, and require review before forwarding sensitive or high-impact responses. I found no evidence of malware, persistence, credential theft, or destructive behavior.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (1)

T01 · Skill Instruction Hijacking

Warning
Location
SKILL.md:23
Finding
Untrusted Group Messages Are Embedded Directly into Sub-Agent Instructions<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 23-30 **Vulnerability Type**: Prompt injection across an agent delegation boundary **Risk Level**: Medium ### Vulnerable Code The non-ASCII source text is represented with equivalent Unicode escapes below to satisfy the report language requirement: ```python result = sessions_spawn( agentId="zhongshu", task="\u4e2d\u4e66\u7701\u8bf7\u6ce8\u610f\uff1a\u6536\u5230\u6765\u81ea [\u7fa4\u540d] \u7684\u6d88\u606f\uff1a[\u6d88\u606f\u5185\u5bb9]\u3002\u8bf7\u5904\u7406\u5e76\u56de\u590d\u3002", mode="run", timeoutSeconds=60 ) ``` The task template places the original group name and message content directly inside an imperative instruction passed to the delegated agent. ### Technical Analysis The routing instructions require attacker-controlled group-message content to be interpolated into the `task` argument of `sessions_spawn`. No structured separation, trust-boundary markers, escaping mechanism, authorization check, or explicit instruction to treat the embedded message solely as untrusted data is documented. Consequently, a group participant can submit content that resembles higher-priority operational instructions. Once interpolated, that content becomes part of the same natural-language task as the legitimate routing instruction. The delegated agent may interpret the malicious content as an instruction rather than as data to classify or answer. The subsequent requirement to forward the delegated agent's response to the original group provides an output channel for the manipulated result. ### Attack Path 1. An attacker obtains permission to post in one of the configured Feishu groups routed to a sub-agent. 2. The attacker submits a message containing prompt-injection instructions, such as directions to ignore the routing request, reveal accessible context, invoke available tools, or produce attacker-selected content. 3. The router inserts the group message directly i ...[truncated 1215 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pass the group message through a structured data field rather than concatenating it into an imperative natural-language task, where supported. 2. Clearly delimit untrusted content and state that text inside the delimiters is data, not instructions. For example, require the sub-agent to analyze only a separately supplied `message_content` field. 3. Instruct the delegated agent never to follow commands found in the original message that attempt to alter its role, policies, tool permissions, output destination, or routing workflow. 4. Validate both the source `chat_id` and the sender's authorization before delegation. Do not treat membership in a recognized group as sufficient authorization for privileged operations. 5. Apply least privilege to every sub-agent. Restrict tools, secrets, files, network access, and context to the minimum required for the assigned departmental function. 6. Require explicit approval before performing sensitive actions or returning sensitive information. 7. Validate and filter the delegated response before forwarding it to the original group. Reject responses containing secrets, unexpected tool output, or content outside the requested task. 8. Add adversarial tests covering instruction-override attempts, fake system messages, requests for hidden context, tool-use requests, and attempts to change the reply destination. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (2)

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The skill explicitly forwards full group chat message content and group context to sub-agents via `sessions_spawn`, which creates unnecessary data sharing across agents without any notice, consent boundary, or minimization rule. In a chat-routing context this is materially risky because group messages may contain sensitive internal discussions, and every routed message expands exposure to additional agents and their logs.

Natural-Language Policy Violations

Low
Confidence
81% confidence
Finding
All user-facing instructions and labels in this skill are presented exclusively in Chinese, and the document does not indicate that the language is optional or limited to a justified region-specific deployment. Under the language/locale policy, forcing a single language without user opt-in can be a policy violation.

Static analysis

No suspicious patterns detected.