Back to skill

Security audit

Feishu Merged Msg

Security checks for vulnerabilities and agentic risk

Overview

The skill does what it says, but it handles Feishu app credentials in a way that can expose long-lived secrets.

Install only if you are comfortable with an agent reading Feishu app credentials from local OpenClaw configuration and using them to call Feishu. Prefer a safer version that does not print appSecret, does not pass secrets as command-line arguments, and clearly limits credential access to the single requested message retrieval task.

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

Error
Location
scripts/fetch_merged_msg.sh:8
Finding

Feishu Credentials and Access Tokens Exposed Through Standard Output and Process Arguments

Content
View full analysis
/scripts/fetch_merged_msg.sh ``` ```bash python3 -c "import json; d=json.load(open('/root/.openclaw/openclaw.json')); c=d['channels']['feishu']; print(c.get('appId',''), c.get('appSecret',''))" ``` `scripts/fetch_merged_msg.sh:8-19`: ```bash MSG_ID="${1:?Usage: fetch_merged_msg.sh }" APP_ID="${2:?Missing app_id}" APP_SECRET="${3:?Missing app_secret}" # 1. Get tenant access token TOKEN=$(curl -sf -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'])") # 2. Fetch message and its sub-messages curl -sf "https://open.feishu.cn/open-apis/im/v1/messages/${MSG_ID}" \ -H "Authorization: Bearer ${TOKEN}" ``` ### Technical Analysis The Skill legitimately needs Feishu credentials to obtain a tenant access token and retrieve merged messages from the official Feishu API. However, its handling of those credentials exceeds the minimum exposure necessary for that operation. The documentation recommends printing the `appSecret` from the root-owned OpenClaw configuration to standard output. It then directs the caller to pass that secret as a positional command-line argument. The script subsequently embeds the secret in curl's `-d` argument. As a result, sensitive data can be exposed through: - Terminal output or captured agent output. - Shell history when a literal invocation is entered interactively. - Process inspection while the script or curl process is running, subject to operating-syst ...[truncated 2410 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (7)

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/fetch_merged_msg.sh (reported line 12)May include surrounding context.

sh
APP_ID="${2:?Missing app_id}"
APP_SECRET="${3:?Missing app_secret}"

# 1. Get tenant access token
TOKEN=$(curl -sf -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}\"}" \

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 · scripts/fetch_merged_msg.sh (reported line 13)May include surrounding context.

sh
APP_SECRET="${3:?Missing app_secret}"

# 1. Get tenant access token
TOKEN=$(curl -sf -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'])")

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill instructs the agent to execute shell commands, including a bash script and a Python one-liner, but declares no tool restrictions or allowed-tools scope. That creates an unnecessary expansion of execution capability and makes it easier for the skill to access local files and secrets beyond its stated purpose.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill explicitly tells the agent to read Feishu app credentials from /root/.openclaw/openclaw.json when they are not otherwise available. This is dangerous because it normalizes secret extraction from local configuration, expanding the skill from message retrieval into credential access and creating a path for accidental disclosure or misuse of sensitive app secrets.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
99% confidence
Finding

The documentation includes a command that prints appId and appSecret directly to stdout with no warning or masking. Exposing secrets in command output can leak them into logs, transcripts, shell history, or downstream model context, making compromise of the Feishu app more likely.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/fetch_merged_msg.sh (reported line 13)May include surrounding context.

sh
APP_SECRET="${3:?Missing app_secret}"

# 1. Get tenant access token
TOKEN=$(curl -sf -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'])")

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code sends the provided app_id and app_secret in an HTTP request to Feishu, which is a safety-relevant network operation involving credentials. The file includes usage comments, but they do not warn that secrets will be transmitted to a remote service or note the sensitivity of providing credentials on the command line.

Content

No source excerpt is available for this finding.