Back to skill

Security audit

create-feishu-agent Skill

Security checks for vulnerabilities and agentic risk

Overview

The skill has a clear Feishu-agent setup purpose, but its helper script and defaults can expose Feishu secrets, overwrite unintended agent files, and let the bot process group messages without being addressed.

Review before installing. Use this only in a trusted local environment, avoid the helper script until agent-name validation and heredoc handling are fixed, rotate any secret passed on a command line, restrict file permissions on OpenClaw config, and prefer requiring mentions or limiting the bot to specific chats.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
create-feishu-agent.sh:89
Finding

<![CDATA[Arbitrary Python Code Execution Through Unsafe Heredoc Interpolation]]>

Content
View full analysis
" ``` into multiple Python statements, including calls to `os.system()` or `subprocess`. ### Impact Assessment Successful exploitation provides ar ...[truncated 499 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
create-feishu-agent.sh:14
Finding

<![CDATA[Path Traversal Allows Files to Be Written Outside the Agent Directory]]>

Content
View full analysis
"$AGENT_DIR/SOUL.md" << 'EOF' # SOUL.md - _一句话描述你的agent_ ## Core Truths **原则1。** 解释... **原则2。** 解释... ## What You Do ### 功能1 - 具体说明 ## Boundaries - 边界1 - 边界2 ## Vibe 性格描述 EOF sed -i '' "s//$DISPLAY_NAME/g" "$AGENT_DIR/SOUL.md" # 3. 创建 AGENTS.md echo "[3/5] 创建 AGENTS.md..." cat > "$AGENT_DIR/AGENTS.md" << EOF # AGENTS.md - $DISPLAY_NAME Workspace 继承主 workspace 规则。 ## 职责 - 职责1 - 职责2 EOF # 4. 创建 MEMORY.md echo "[4/5] 创建 MEMORY.md..." cat > "$AGENT_DIR/MEMORY.md" << 'EOF' # MEMORY.md - 长期记忆 ``` ### Technical Analysis `AGENT_NAME` is accepted without validation and appended directly to the intended Agent root: ```bash AGENT_DIR="$WORKSPACE/agents/$AGENT_NAME" ``` Quoting the resulting path prevents word splitting but does not prevent path traversal. An input containing `../` components can resolve outside `$WORKSPACE/agents`. The subsequent redirections use truncating writes. Therefore, if the resolved destination contains existing files named `SOUL.md`, `AGENTS.md`, or `MEMORY.md`, those files are replaced without confirmation. The script can also create a `memory` directory at the escaped destination. Because these filenames have special meaning in OpenClaw workspaces, traversal into another Agent directory can corrupt or replace that Agent's persistent instructions and memory. ### Attack Path 1. An attacker supplies an Agent name containing traversal components, such as a value resol ...[truncated 1173 chars]
Remediation
View remediation
&2 exit 1 fi ``` Then canonicalize and verify the destination: ```bash AGENTS_ROOT="$WORKSPACE/agents" mkdir -p "$AGENTS_ROOT" AGENTS_ROOT_REAL="$(cd "$AGENTS_ROOT" && pwd -P)" AGENT_DIR="$AGENTS_ROOT/$AGENT_NAME" AGENT_PARENT_REAL="$(cd "$(dirname "$AGENT_DIR")" && pwd -P)" if [[ "$AGENT_PARENT_REAL" != "$AGENTS_ROOT_REAL" ]]; then echo "Agent directory escapes the permitted root." >&2 exit 1 fi ``` Further hardening should include: 1. Reject empty names, dot components, path separators, and control characters. 2. Refuse to overwrite an existing Agent unless the user explicitly provides a safe overwrite flag. 3. Create files with `noclobber` or perform existence checks where replacement is unnecessary. 4. Stage generated files in a secure temporary directory beneath the validated root. 5. Atomically move validated files into place. 6. Add tests covering `../`, absolute paths, symbolic links, empty names, and unusual Unicode separators. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
create-feishu-agent.sh:3
Finding

<![CDATA[Feishu App Secret Is Exposed Through Command-Line Arguments]]>

Content
View full analysis
set -e if [ $# -lt 4 ]; then echo "用法: $0 " echo "示例: $0 health_manager '健康助手' cli_xxx xxx" exit 1 fi AGENT_NAME=$1 DISPLAY_NAME=$2 APP_ID=$3 APP_SECRET=$4 ``` The reference documentation also instructs users to place the secret directly in the command: ```bash ~/.openclaw/workspace/skills/create-feishu-agent/create-feishu-agent.sh \ "<显示名称>" ~/.openclaw/workspace/skills/create-feishu-agent/create-feishu-agent.sh \ tech_expert "技术专家" cli_xxx xxxsecret ``` ### Technical Analysis The script requires the Feishu App Secret as its fourth command-line argument. Command-line arguments are not an appropriate transport for long-lived credentials because they can be recorded or observed through mechanisms outside the script's control. Depending on the environment, the secret may be exposed through: - Interactive shell history. - Process inspection utilities while the script is running. - Process accounting or endpoint-monitoring systems. - Automation logs that record invoked commands. - Terminal transcripts, troubleshooting output, or copied command examples. The documentation reinforces this unsafe usage pattern instead of providing a protected input mechanism. ### Attack Path 1. A user invokes the script with the real Feishu App Secret as the fourth argument. 2. The complete command is stored in shell history, automation logs, or process-monitoring records. 3. Another user, administrator, support operator, or compromised process obtains those records. 4. The observer extracts the App ID and Ap ...[truncated 823 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (8)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The document explicitly recommends groupPolicy: "open" and requireMention: false, allowing the agent to process all group messages without being addressed. This materially increases passive message collection, accidental triggering, and the chance that sensitive group content is ingested or acted on without clear user intent.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger conditions are broad natural-language phrases such as 'create a new agent' and 'add Feishu bot', which can overlap with ordinary discussion and cause the skill to activate unexpectedly. In a skill that creates files, edits configuration, and binds messaging channels, accidental activation can lead to unintended workspace changes or bot deployment.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · SKILL.md (reported line 17)May include surrounding context.

bash
# 在 workspace/agents/ 下创建新 agent
mkdir -p ~/.openclaw/workspace/agents/<agent_name>

# 必需文件
touch ~/.openclaw/workspace/agents/<agent_name>/SOUL.md      # 人设文件

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill instructs operators to record and place App Secret directly into configuration but provides no guidance on secure secret handling. This creates a realistic risk of credentials being stored in plaintext, copied into logs, committed to repositories, or exposed through permissive filesystem access.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script persists the provided Feishu app credentials directly into a long-lived JSON config under the user's home directory, and it does so without checking file permissions, offering a safer secret store, or clearly warning the operator that sensitive credentials will be written to disk. If the config file is readable by other local users, copied into backups, committed accidentally, or harvested by malware, the appId/appSecret can be exposed and used to impersonate or control the configured Feishu integration.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

This markdown file presents all instructions, headings, and operational guidance in Chinese only. Under the policy rule for language or locale constraints, this can be a natural-language policy violation when the skill forces a specific language without user opt-in or justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
72% confidence
Finding

整份技能说明与模板均仅以中文编写,并未说明这是面向特定中文用户群或区域场景的限定,也未提供其他语言选项。若该技能面向通用用户,这种默认强制单一语言可能构成语言/locale 策略上的不充分选择。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

Comments, usage output, progress messages, and generated markdown content are written in Chinese throughout the script. This imposes a specific language on all users without opt-in or documentation that the skill is intended only for a Chinese-speaking or region-specific context.

Content

No source excerpt is available for this finding.