Back to skill

Security audit

飞书发文件(免费)

Security checks for vulnerabilities and agentic risk

Overview

The skill is for sending local files to Feishu, but its instructions handle Feishu secrets unsafely and could expose credentials in logs or command history.

Install only if you are comfortable with a skill that can send local files to Feishu. Before use, confirm the exact file path and recipient, avoid sending sensitive files accidentally, do not paste real app_secret values into command lines, and prefer a scoped secret manager or environment setup that does not print secrets into logs or transcripts.

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:95
Finding

Feishu Application Secret Exposed Through Command Output and Process Arguments

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 95–120
Vulnerability Type: Credential exposure through terminal output, execution logs, shell history, and process arguments
Risk Level: Medium

Vulnerable Code

bash
python3 (请参考skill目录中的脚本文件) <file_path> <open_id> <app_id> <app_secret> [file_name]
bash
grep -A 2 '"feishu"' /root/.skill-platform/skill-platform.json | grep -E '(appId|appSecret)'
bash
python3 /root/.skill-platform/workspace/skills/feishu-send-file/(请参考skill目录中的脚本文件) \
  /root/myfiles/report.html \
  ou_abc123def456 \
  cli_a1b2c3d4e5f6g7h8 \
  secretAbCdEfGhIjKlMnOp \
  weekly-report.html

Technical Analysis

The documented workflow retrieves both the Feishu application ID and application secret by printing matching configuration entries to standard output. In an AI-agent environment, this output may be retained in execution logs, conversation transcripts, terminal scrollback, or platform telemetry.

The workflow then passes app_secret as a positional command-line argument. On systems where process metadata is visible to other users or monitoring services, the secret may be exposed through process listings such as /proc/*/cmdline or ps. It may also remain in shell history and command audit records after execution.

Although the credential values shown in the example appear illustrative rather than confirmed live secrets, users are explicitly instructed to substitute their actual Feishu credentials into these unsafe channels. The secret is not required to be printed or supplied as a process argument to perform the legitimate file-upload operation.

Attack Path

  1. A user follows the skill instructions and runs the recommended grep command against skill-platform.json.
  2. The real appSecret is written to terminal output and potentially retained by the Agent platform, execution logger, or transcript system.
  3. The user invokes the referenced Python script with the application secret a ...[truncated 1137 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove app_secret from all positional command-line interfaces.
  2. Have the implementation read credentials directly from a secret manager or a permission-restricted configuration file without printing them.
  3. If environment variables must be supported, read the secret within the process and ensure that commands, debugging output, exceptions, and execution logs never echo its value.
  4. Replace the configuration lookup command with a mechanism that confirms credential presence without displaying the secret.
  5. Redact credentials in Agent transcripts, shell tracing, telemetry, and error messages.
  6. Prevent shell history retention for any unavoidable credential-handling operation, while recognizing that this does not mitigate process-list exposure.
  7. Restrict the credential file to the service account that needs it, such as with mode 0600, and apply least-privilege Feishu API scopes.
  8. Rotate the application secret if the documented commands have already been used with a real credential in a logged environment.
  9. Include the referenced script in the package and implement secure credential loading rather than requiring users to improvise the missing implementation.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (6)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The description says the skill is suitable for general 'feishu send file related capability' and 'related development scenarios' without defining concrete trigger phrases, boundaries, or exclusion conditions. In a manifest/markdown context, this is ambiguous enough to risk unintended invocation because the activation scope is not narrowly specified.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The documentation tells the agent to upload local files to Feishu without a prominent warning that local file contents will be transmitted to an external service and recipient. In an agent context, that can lead to accidental exfiltration of sensitive workspace files if the user or model treats 'send file' as a benign local formatting step.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill's credential guidance is inconsistent: it says to configure a generic API_KEY while the actual workflow uses Feishu app_id/app_secret. This mismatch can cause operators to improvise secret handling, increasing the chance of storing or exposing the real Feishu credentials insecurely and misunderstanding which secrets are actually required.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill instructs reading platform-wide secret configuration from /root/.skill-platform/skill-platform.json to obtain appId and appSecret. That exceeds the minimum behavior needed for file sending and encourages the agent or user to access a central secret store, which can expose unrelated credentials or normalize secret scraping behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The examples place app_id and app_secret directly in command arguments. Command-line arguments are often exposed through shell history, process listings, logs, and transcripts, so this pattern materially increases the risk of credential disclosure and later compromise of the Feishu application.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
89% confidence
Finding

This skill performs intentional external transmission by uploading a local file to Feishu and then sending it to a recipient. In context, external transmission is the core feature rather than inherently malicious, but it is still security-relevant because it can exfiltrate sensitive local content if invoked on the wrong file or with insufficient user consent.

Content

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

md
-d '{"app_id":"<APP_ID>","app_secret":"<APP_SECRET>"}' \
  | python3 -c "import json,sys; print(json.load(sys.stdin)['tenant_access_token'])")
# ...
FILE_KEY=$(curl -s -X POST "https://open.feishu.cn/open-apis/im/v1/files" \
  -H "Authorization: Bearer $TOKEN" \
  -F "file_type=stream" \
  -F "file_name=<文件名>" \

Static analysis

No suspicious patterns detected.