Back to skill

Security audit

飞书多维表格文件上传

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to upload files to Feishu as advertised, but it handles Feishu credentials in ways that can leak secrets through command history or logs.

Review before installing. Use this only for files you are authorized to upload to Feishu, prefer a secret manager or tightly controlled environment variables instead of --app-secret on the command line, restrict access to execution logs, and remove the token-prefix log if maintaining the skill.

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

T09 · Insecure Skill Coding Practices

Warning
Location
--parent-node <APP_TOKEN> \ --app-id <APP_ID> --app-secret <APP_SECRET> ``` ### Technical Analysis The script accepts the Feishu App Secret through the `--app-secret` command-line argument. Secrets supplied this way can be recorded in interactive shell history and exposed in process metadata while the script is running. Depending on operating-system process isolation and monitoring configuration, local users, process-monitoring agents, diagnostic collectors, or CI logging systems may be able to retrieve ...[truncated 1644 chars]:64
Finding

Feishu App Secret Exposed Through Command-Line Arguments

Content
View full analysis
--parent-node \ --app-id --app-secret ``` ### Technical Analysis The script accepts the Feishu App Secret through the `--app-secret` command-line argument. Secrets supplied this way can be recorded in interactive shell history and exposed in process metadata while the script is running. Depending on operating-system process isolation and monitoring configuration, local users, process-monitoring agents, diagnostic collectors, or CI logging systems may be able to retrieve the argument. Although environment-variable input is also supported, the insecure argument mode is explicitly implemented and presented as a standard usage method. The script therefore encourages users to expose a long-lived application credential through channels not designed for secret storage. ### Attack Path 1. A user follows the documented argument-mode example and invokes the script with `--app-secret `. 2. The command is retained in shell history, CI command logs, terminal auditing records, or process telemetry. While the process is active, the argument may also be available through process inspection where local access controls permit it. 3. An attacker or unauthorized operator with access to one of those records retrieves the App ID and App Secret. 4. The attacker submits the stolen credentials to the Feishu tenant-token endpoint. 5. If the credentials remain valid ...[truncated 620 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
scripts/feishu_upload.sh:139
Finding

Tenant Bearer Token Prefix Disclosed in Execution Logs

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • 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)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill documentation indicates shell-script execution but does not declare any explicit tool scope or allowed-tools restrictions. That increases the chance an agent may invoke shell capabilities more broadly than intended, reducing sandboxing and reviewability for a skill that handles local files and external uploads.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill requires users to provide App ID/App Secret credentials and upload arbitrary local files to Feishu, but the documentation does not clearly warn that both sensitive credentials and file contents will be transmitted to an external service. This omission can lead to accidental disclosure of secrets or confidential files, especially in agent-driven workflows where users may not realize data leaves the local environment.

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_upload.sh (reported line 122)May include surrounding context.

sh
fi

echo "[Auth] 获取 tenant_access_token..."
TOKEN_RESP=$(curl -s -X POST "${FEISHU_BASE}/open-apis/auth/v3/tenant_access_token/internal" \
    -H "Content-Type: application/json" \
    -d "{\"app_id\":\"${APP_ID}\",\"app_secret\":\"${APP_SECRET}\"}")

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script promises to return a file_token for downstream use, but it also prints the first part of the tenant access token to stdout/stderr during authentication. Even partial credential disclosure is sensitive in agent environments because logs are often centrally collected, exposed to users, or forwarded to other tools; it also violates least disclosure for a token not needed by the caller.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
99% confidence
Finding

The line echo "[Auth] token 获取成功(${BEARER_TOKEN:0:20}...)" exposes part of a live bearer token. In automation and agent settings, console output is frequently retained in transcripts and CI logs, so this creates unnecessary credential leakage and can aid token correlation, debugging abuse, or accidental disclosure to untrusted viewers.

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_upload.sh (reported line 164)May include surrounding context.

sh
echo "[2] 预上传,获取 upload_id..." >&2

    local prepare_resp
    prepare_resp=$(curl -s -X POST "${FEISHU_BASE}/open-apis/drive/v1/medias/upload_prepare" \
        -H "Authorization: Bearer ${BEARER_TOKEN}" \
        -H "Content-Type: application/json; charset=utf-8" \
        -d "{\"file_name\":\"${FILE_NAME}\",\"parent_type\":\"${PARENT_TYPE}\",\"parent_node\":\"${PARENT_NODE}\",\"size\":${FILE_SIZE}}")

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_upload.sh (reported line 217)May include surrounding context.

sh
echo "[4] 完成上传..." >&2

    local finish_resp
    finish_resp=$(curl -s -X POST "${FEISHU_BASE}/open-apis/drive/v1/medias/upload_finish" \
        -H "Authorization: Bearer ${BEARER_TOKEN}" \
        -H "Content-Type: application/json; charset=utf-8" \
        -d "{\"upload_id\":\"${upload_id}\",\"block_num\":${block_num}}")

Static analysis

No suspicious patterns detected.