Back to skill

Security audit

Feishu Webhook Skill

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed Feishu/Lark webhook helper, with credential-handling cautions but no evidence of hidden execution, exfiltration, persistence, or destructive behavior.

Install only if you intend the agent to send Feishu/Lark webhook messages and upload selected images to Feishu. Use FEISHU_TENANT_ACCESS_TOKEN through a protected environment or secret mechanism, avoid --token in commands, confirm webhook URLs and message contents before sending, and do not upload sensitive images unless they are meant to be shared in Feishu.

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
scripts/upload_image.py:78
Finding

Tenant Access Token Exposure Through Command-Line Arguments

Content
View full analysis

Vulnerability Details

File Location: scripts/upload_image.py, lines 78–82
Vulnerability Type: Credential exposure through process arguments and shell history
Risk Level: Medium

Vulnerable Code

python
parser.add_argument(
    "--token",
    default=None,
    help="tenant_access_token(不传则从环境变量 FEISHU_TENANT_ACCESS_TOKEN 获取)",
)

The insecure invocation method is also documented in webhook-image.md, lines 47–48:

bash
# 指定 token
uv run upload_image.py <image_path> --token <tenant_access_token>

Technical Analysis

The script permits a Feishu tenant access token to be supplied directly through the --token command-line option. Command-line arguments are not an appropriate secret-transport mechanism because they may be exposed through:

  • Process inspection utilities and operating-system process interfaces.
  • Shell command history.
  • Process-monitoring and endpoint-management agents.
  • CI/CD task logs, wrapper scripts, and debugging telemetry.
  • Error reports that record complete command invocations.

The script already supports retrieving the token from FEISHU_TENANT_ACCESS_TOKEN, which avoids placing it in the process argument vector. However, the documentation explicitly promotes the less secure command-line alternative.

The bearer-token transmission itself at scripts/upload_image.py:57-69 is necessary for the declared image-upload functionality and is limited to Feishu's official HTTPS endpoint, https://open.feishu.cn/open-apis/im/v1/images. The vulnerability concerns local handling of the credential before that transmission, not the intended API request.

Attack Path

  1. A user follows the documented example and runs the uploader with --token &lt;tenant_access_token&gt;.
  2. The token is stored in the process argument vector and may also remain in shell history or execution logs.
  3. A local process-inspection user, monitoring service, log reader, or ...[truncated 1099 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove the --token argument and obtain the credential exclusively from FEISHU_TENANT_ACCESS_TOKEN, an operating-system secret manager, or another protected credential provider.
  2. If interactive entry is required, use a non-echoing prompt such as Python's getpass.getpass() rather than a command-line argument.
  3. Remove the command-line token example from webhook-image.md and document the protected environment-variable or secret-manager workflow instead.
  4. If backward compatibility requires retaining --token, clearly mark it as deprecated and insecure, avoid displaying it in examples, and reject its use in shared, logged, or multi-user environments.
  5. Ensure CI/CD systems inject the token through masked secret variables and do not print environment values or complete command invocations.
  6. Rotate any tenant access token that may previously have been supplied through command-line arguments in environments where process lists, shell histories, or logs are accessible.
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
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (11)

Tainted flow: 'headers' from os.environ.get (line 65, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/upload_image.py (reported line 69)May include surrounding context.

python
"Authorization": f"Bearer {token}",
            "Content-Type": form.content_type,
        }
        response = requests.post(url, headers=headers, data=form, timeout=30)

    result = response.json()
    return result

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The documented behavior does not match the described purpose: the skill claims broad webhook messaging support, while the analysis indicates the implemented behavior is narrower and different. This kind of mismatch is dangerous because operators may approve or invoke the skill under false assumptions, causing unintended secret handling, unexpected network activity, or bypass of review controls.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill declares capabilities that rely on network access and environment secrets (FEISHU_TENANT_ACCESS_TOKEN) but does not explicitly scope or constrain those permissions. In an agent environment, missing tool/permission declarations weakens least-privilege controls and can enable unintended outbound requests or secret use beyond what a reviewer expects.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger keywords are broad common terms such as '消息', '通知', 'Feishu', and 'webhook', making accidental activation likely during ordinary conversation. In a skill that can send network messages and use authentication material, overbroad triggering increases the chance of unintended external actions or disclosure through misrouting user requests into this skill.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The manifest describes a skill for sending Feishu/Lark webhook messages, including plain text, rich text, interactive cards, and image upload to support messaging. This script also supports image_type="avatar", and its CLI help explicitly says it can be used for setting an avatar, which is a separate profile-management capability not justified by webhook message sending.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The script transmits a local image file to Feishu's external API but provides no explicit warning, consent prompt, or privacy notice at the point of upload. In agent or automation contexts, this can lead to accidental disclosure of sensitive screenshots, documents, or embedded metadata to a third-party service when users may not realize the privacy impact.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

该 markdown 文档全文以中文编写,未见任何关于可选语言、用户语言偏好或区域性适用范围的说明。根据规则,技能若强制特定语言而未提供用户选择或明确正当性,属于自然语言层面的语言/地区政策问题。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This markdown file presents all user-facing instructional content exclusively in Chinese and does not offer an opt-in language choice, translation option, or justification that the skill is intended only for a Chinese-speaking or region-specific audience. That creates a natural-language locale policy concern under the rule for forced language without user choice.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The document instructs users to pass a sensitive tenant_access_token either via an environment variable or directly on the command line (--token <tenant_access_token>), but it does not warn that command-line arguments can be exposed through shell history, process listings, logs, or terminal recordings. Because this skill is specifically designed to send Feishu messages and upload images, misuse or leakage of the token could let an attacker interact with the tenant's Feishu resources with the token's privileges.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The document title and introductory text are entirely in Chinese, with no indication that the user may choose another language or that the locale restriction is intentional. Under the policy rule for natural-language violations, forcing a specific language without user opt-in is a reportable issue.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

该 markdown 文件全文以中文撰写,用于说明组件能力与使用方式,但文档中没有提供语言/locale 选择,也没有声明这是仅面向中文用户或特定区域的文档。按规则,强制单一语言且无用户选择或合理限定,属于自然语言层面的语言/locale 策略问题。

Content

No source excerpt is available for this finding.