Back to skill

Security audit

Feishu Send Image

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it says by sending images through Feishu, but it exposes Feishu app credentials in risky ways and includes a secret-looking example value.

Install only if you trust the publisher and are comfortable giving the skill access to Feishu app credentials that can send bot messages and upload images. Replace the concrete example values, rotate the Feishu secret if they might be real, and prefer a protected secret store or restricted config file over command-line arguments.

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

Warning
Location
scripts/feishu_send_image.sh:13
Finding

Feishu Application Secret Exposed Through Command-Line Arguments

Content
View full analysis
[receive_id_type]}" RECEIVE_ID="${2:?Missing receive_id}" APP_ID="${3:?Missing app_id}" APP_SECRET="${4:?Missing app_secret}" RECEIVE_ID_TYPE="${5:-open_id}" ``` The documented invocation explicitly places the secret on the command line: ```bash bash scripts/feishu_send_image.sh [receive_id_type] ``` ### Technical Analysis The script requires the Feishu application secret as positional argument four. Command-line arguments are not a secure channel for secrets. Depending on the host configuration and execution environment, they may be exposed through: - Process inspection utilities and `/proc` while the script is running. - Shell command history. - Process auditing and endpoint monitoring. - Job runners, debugging output, or orchestration telemetry that records command lines. - Wrapper scripts or agent logs that preserve the invocation. The secret is legitimately needed to obtain a Feishu tenant access token, but exposing it as a process argument exceeds the minimum disclosure necessary for that operation. ### Attack Path 1. A user or agent invokes the script according to the documented command format and supplies a valid app secret. 2. A local user, monitoring component, or compromised process observes the command line while it is running or later reads retained shell/audit logs. 3. The observer extracts the Feishu app ID and app secret. 4. The observer submits those credentials to Feishu's tenant-token endpoint. 5. If the credentials remain valid, the observer invokes Feishu APIs with the permissi ...[truncated 665 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:34
Finding

Credential-Like Feishu Secret Embedded in Skill Documentation

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
scripts/feishu_send_image.sh:23
Finding

Untrusted Values Interpolated Directly into JSON Request Bodies

Content
View full analysis
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
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (12)

Ssd 3

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill instructs the model/operator to retrieve app secrets from a local configuration file and use them to authenticate an external API request. This is a classic secret-exfiltration pattern: local sensitive data is accessed specifically to enable an outbound action, which is dangerous in an agent setting because it normalizes secret extraction from local storage for remote use.

Content

No source excerpt is available for this finding.

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/feishu_send_image.sh (reported line 21)May include surrounding context.

sh
RECEIVE_ID_TYPE="${5:-open_id}"

# Step 1: Get tenant_access_token
TOKEN_RESP=$(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\"}")

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/feishu_send_image.sh (reported line 27)May include surrounding context.

sh
TOKEN=$(echo "$TOKEN_RESP" | python3 -c "import sys,json; print(json.load(sys.stdin)['tenant_access_token'])" 2>/dev/null)
if [ -z "$TOKEN" ]; then
  echo "ERROR: Failed to get access token" >&2
  echo "$TOKEN_RESP" >&2
  exit 1
fi

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/feishu_send_image.sh (reported line 33)May include surrounding context.

sh
fi

# Step 2: Upload image to get image_key
UPLOAD_RESP=$(curl -s -X POST 'https://open.feishu.cn/open-apis/im/v1/images' \
  -H "Authorization: Bearer $TOKEN" \
  -F 'image_type=message' \
  -F "image=@$IMAGE_PATH")

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/feishu_send_image.sh (reported line 46)May include surrounding context.

sh
fi

# Step 3: Send image message
SEND_RESP=$(curl -s -X POST "https://open.feishu.cn/open-apis/im/v1/messages?receive_id_type=$RECEIVE_ID_TYPE" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d "{\"receive_id\":\"$RECEIVE_ID\",\"msg_type\":\"image\",\"content\":\"{\\\"image_key\\\":\\\"$IMAGE_KEY\\\"}\"}")

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This markdown file instructs users to pass app_id and app_secret on the command line and points them to a local config file containing those credentials, while the skill's purpose includes uploading images and sending messages over the network. The description does not include any warning about exposing secrets in shell history/process lists or about transmitting image data and identifiers to Feishu.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill explicitly instructs running a shell script and directly invoking external network operations, but it declares no tool scope or allowed-tools restrictions. That creates an under-specified trust boundary: an agent may execute shell capability broader than necessary, increasing the chance of unintended command execution or misuse in contexts where shell access should have been denied or narrowly constrained.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The documentation tells the operator to pass Feishu app credentials as command-line arguments and use them in API calls, but provides no warning that command-line secrets can leak via shell history, process listings, logs, or agent traces. Even if the destination API is legitimate, handling secrets this way materially increases exposure risk and could lead to credential compromise.

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/feishu_send_image.sh (reported line 21)May include surrounding context.

sh
RECEIVE_ID_TYPE="${5:-open_id}"

# Step 1: Get tenant_access_token
TOKEN_RESP=$(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\"}")

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
82% confidence
Finding

The script sends app_id and app_secret to Feishu's token endpoint to obtain an access token. Although the arguments are named in comments, there is no runtime warning, prompt, or stronger disclosure that credentials will be transmitted over the network to a third-party service.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The script uploads the local file at IMAGE_PATH to Feishu's remote API, which is a network operation transmitting user data. While the header comments describe usage, the executable flow provides no confirmation prompt or runtime disclosure before sending the image contents off-host.

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/feishu_send_image.sh (reported line 46)May include surrounding context.

sh
fi

# Step 3: Send image message
SEND_RESP=$(curl -s -X POST "https://open.feishu.cn/open-apis/im/v1/messages?receive_id_type=$RECEIVE_ID_TYPE" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d "{\"receive_id\":\"$RECEIVE_ID\",\"msg_type\":\"image\",\"content\":\"{\\\"image_key\\\":\\\"$IMAGE_KEY\\\"}\"}")