Back to skill

Security audit

feishu-files

Security checks for vulnerabilities and agentic risk

Overview

The skill is for sending Feishu files, but it tells agents to read raw Feishu credentials from a root config file and use broad shell/curl commands without clear safeguards.

Review before installing. Use only with a Feishu app whose permissions are tightly scoped for upload/message sending, avoid running it as root, confirm the exact recipient and file before each send, and prefer a safer token/client workflow that does not expose app secrets or bearer tokens in command arguments or logs.

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 (1)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:10
Finding

Feishu Credentials Exposed Through Process Command-Line Arguments

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 10–16 and 19–28
Vulnerability Type: Sensitive credential exposure through process arguments
Risk Level: Medium

Complete Code Snippet:

sh
APP_SECRET=$(python3 -c "import json; c=json.load(open('/root/.openclaw/openclaw.json')); print(c['channels']['feishu']['appSecret'])")
APP_ID=$(python3 -c "import json; c=json.load(open('/root/.openclaw/openclaw.json')); print(c['channels']['feishu']['appId'])")
TOKEN=$(curl -s -X POST 'https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal' \
-H 'Content-Type: application/json' \
-d '{"app_id":"'$APP_ID'","app_secret":"'$APP_SECRET'"}' \
| python3 -c "import json,sys; print(json.load(sys.stdin)['tenant_access_token'])")

IMAGE_KEY=$(curl -s -X POST 'https://open.feishu.cn/open-apis/im/v1/images' \
-H "Authorization: Bearer $TOKEN" \
-F "image_type=message" \
-F "image=@/path/to/image.png" \
| python3 -c "import json,sys; print(json.load(sys.stdin)['data']['image_key'])")

curl -s -X POST 'https://open.feishu.cn/open-apis/im/v1/messages?receive_id_type=open_id' \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"receive_id":"收信人open_id","msg_type":"image","content":"{\"image_key\":\"'$IMAGE_KEY'\"}"}'

Technical Analysis

The documented commands read a Feishu application secret from /root/.openclaw/openclaw.json, expand it into curl's -d command-line argument, and subsequently expand the tenant bearer token into curl's -H argument. Although these credentials are legitimately needed to authenticate to Feishu, placing them in process arguments is unnecessary and unsafe.

Depending on operating-system configuration and local permissions, command-line arguments may be observable through process-listing utilities, /proc, system auditing, monitoring agents, diagnostic tooling, or command telemetry. This can expose both the long-lived application se ...[truncated 2643 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace shell commands that interpolate secrets into argv with a small, reviewed client using an HTTP library. Construct the JSON request body and authorization headers in process memory.
  2. If curl must be retained, pass the authentication body through standard input rather than -d with expanded secrets. Use a securely permissioned temporary header/config file or another mechanism that does not expose the bearer token in argv, and delete temporary material immediately.
  3. Run the Skill under a dedicated, unprivileged account rather than relying on /root/.openclaw/openclaw.json.
  4. Store only the required Feishu credentials in a dedicated secret store or configuration file readable exclusively by the service account.
  5. Restrict the Feishu application's scopes to image/file upload and message sending only where possible.
  6. Validate and explicitly approve the local file path and intended recipient before transmission to prevent accidental disclosure.
  7. Avoid verbose command tracing and ensure logs, monitoring systems, and shell history do not record credentials or authorization headers.
  8. Rotate the Feishu application secret immediately if it may already have appeared in process telemetry or logs, and revoke active tokens where supported.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (7)

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

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

md
### Step 1: 获取tenant_access_token
APP_SECRET=$(python3 -c "import json; c=json.load(open('/root/.openclaw/openclaw.json')); print(c['channels']['feishu']['appSecret'])")
APP_ID=$(python3 -c "import json; c=json.load(open('/root/.openclaw/openclaw.json')); print(c['channels']['feishu']['appId'])")
TOKEN=$(curl -s -X POST 'https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal' \
-H 'Content-Type: application/json' \
-d '{"app_id":"'$APP_ID'","app_secret":"'$APP_SECRET'"}' \
| python3 -c "import json,sys; print(json.load(sys.stdin)['tenant_access_token'])")

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

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

md
| python3 -c "import json,sys; print(json.load(sys.stdin)['tenant_access_token'])")

### Step 2: 上传图片获取image_key
IMAGE_KEY=$(curl -s -X POST 'https://open.feishu.cn/open-apis/im/v1/images' \
-H "Authorization: Bearer $TOKEN" \
-F "image_type=message" \
-F "image=@/path/to/image.png" \

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill instructs operators to read Feishu app credentials directly from a local config file and use them in shell commands that transmit data externally, but provides no guidance on secret handling, least privilege, or safe execution. In an agent-skill context, this increases the chance of credential exposure, misuse, or unintended outbound data transfer by users following the instructions verbatim.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
91% confidence
Finding

This step sends locally retrieved Feishu app credentials to an external API endpoint to obtain an access token. Although contacting the legitimate Feishu API is expected for functionality, the skill materially enables outbound transmission of sensitive credentials from a local secret store via shell commands, which is dangerous in an agent environment if executed without strict user consent and secret isolation.

Content

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

md
### Step 1: 获取tenant_access_token
APP_SECRET=$(python3 -c "import json; c=json.load(open('/root/.openclaw/openclaw.json')); print(c['channels']['feishu']['appSecret'])")
APP_ID=$(python3 -c "import json; c=json.load(open('/root/.openclaw/openclaw.json')); print(c['channels']['feishu']['appId'])")
TOKEN=$(curl -s -X POST 'https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal' \
-H 'Content-Type: application/json' \
-d '{"app_id":"'$APP_ID'","app_secret":"'$APP_SECRET'"}' \
| python3 -c "import json,sys; print(json.load(sys.stdin)['tenant_access_token'])")

External Transmission

Medium
Category
Data Exfiltration
Confidence
88% confidence
Finding

This step performs an external API call that sends a message to a specified Feishu recipient using a bearer token obtained earlier. In a skill context, this creates a real outbound data exfiltration path for local content or user-supplied files/messages, especially because the instructions normalize using exec/curl rather than a constrained messaging primitive.

Content

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

md
| python3 -c "import json,sys; print(json.load(sys.stdin)['data']['image_key'])")

### Step 3: 发送图片消息
curl -s -X POST 'https://open.feishu.cn/open-apis/im/v1/messages?receive_id_type=open_id' \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"receive_id":"收信人open_id","msg_type":"image","content":"{\"image_key\":\"'$IMAGE_KEY'\"}"}'

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The entire README is written only in Chinese and does not offer any language or locale choice, which can violate a language/locale policy when no opt-in or justification is provided. The content appears to be general setup guidance rather than a clearly region-scoped compliance or locale-specific tool.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The manifest description broadly claims the skill sends files to Feishu, which implies general file transfer capability. However, the documentation explicitly states only images and videos were tested and shows an implementation for image-message upload/send via Feishu APIs, not generic file sending.

Content

No source excerpt is available for this finding.