Back to skill

Security audit

Feishu Cards

Security checks for vulnerabilities and agentic risk

Overview

This Feishu card-sending skill does what it claims, but it ships a hardcoded Feishu app secret and uses shared default credentials for message-sending authority.

Review this before installing. The skill can send Feishu messages through a bundled default app credential if you do not provide your own FEISHU_APP_ID and FEISHU_APP_SECRET. That shared secret should be treated as exposed and rotated by the publisher; users should prefer their own least-privileged Feishu app credentials and avoid sending sensitive content until the credential handling and recipient-type bug are fixed.

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/feishu_card_sender.py:15
Finding

Hardcoded Feishu Application Credentials

Content
View full analysis

Vulnerability Details

File Location: scripts/feishu_card_sender.py, lines 15–16
Vulnerability Type: Hardcoded secret
Risk Level: High

python
APP_ID = os.environ.get("FEISHU_APP_ID", "cli_a9f13ef641f8dcd9")
APP_SECRET = os.environ.get("FEISHU_APP_SECRET", "z7Aq63KvIUJNVRA5UbtOkd48on8rmA26")

Technical Analysis

The source code embeds a live-looking Feishu application ID and application secret as fallback values. If the corresponding environment variables are absent, the Skill automatically authenticates with these shared credentials.

Anyone who can obtain the Skill package or source code can extract the credentials. The application secret is then usable with the official Feishu tenant-token endpoint invoked by get_token():

python
url = "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal"
resp = requests.post(url, json={"app_id": self.app_id, "app_secret": self.app_secret})

Sending a user-supplied application secret to Feishu's official authentication endpoint is necessary for the declared functionality. Embedding a shared secret in distributed source code is not necessary and violates least-secret-exposure principles. Environment-variable support does not mitigate the exposure because the hardcoded value remains available to every recipient of the package.

Attack Path

  1. An attacker downloads the Skill or obtains read access to its source.
  2. The attacker extracts the hardcoded application ID and secret from lines 15–16.
  3. The attacker submits those credentials to Feishu's internal tenant-access-token endpoint.
  4. If the credentials remain valid, Feishu returns a tenant access token.
  5. The attacker invokes Feishu APIs authorized for the application, including potentially sending messages as the application.
  6. The attacker can continue using the credentials until the secret is revoked, rotated, or otherwise invalidated.

Impact Assessment

If th ...[truncated 761 chars]

Remediation
View remediation

Remediation Suggestions

  1. Revoke and rotate the exposed Feishu application secret immediately; removing it from the current source is insufficient if it has already been distributed.
  2. Remove all hardcoded credential fallback values:
    python
    APP_ID = os.environ.get("FEISHU_APP_ID")
    APP_SECRET = os.environ.get("FEISHU_APP_SECRET")
    
  3. Fail closed before making any network request when either credential is absent:
    python
    if not APP_ID or not APP_SECRET:
        raise RuntimeError(
            "FEISHU_APP_ID and FEISHU_APP_SECRET must be configured securely"
        )
    
  4. Prefer a managed secret store or platform credential provider over plaintext environment configuration where available.
  5. Ensure credentials are never written to logs, exception messages, command-line arguments, examples, test fixtures, or generated artifacts.
  6. Review repository history, release archives, package registries, caches, and build logs for previous copies of the secret.
  7. Audit Feishu token issuance and API activity for unauthorized use of the exposed application.
  8. Restrict the Feishu application to the minimum API scopes and tenant resources required to send cards.
  9. Add automated secret scanning and pre-commit checks to prevent future credential commits.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (8)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The script embeds default Feishu app credentials directly in source code, causing anyone with access to the file to inherit active secrets unless they override environment variables. Hardcoded credentials are easily leaked through source control, logs, redistribution, or reuse, enabling unauthorized token issuance and API access under the associated tenant.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill explicitly sends message content and recipient identifiers to the Feishu Open API, but the documentation does not clearly disclose that user-provided data leaves the local environment and is transmitted to a third-party service. This can lead to unintentional disclosure of sensitive content, recipient metadata, or regulated data if users assume the action is local or internal-only.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The script sends authentication data to Feishu and later transmits recipient identifiers and message/card content to Feishu's messaging API. Although the final success/error print exists, there is no prior warning, comment, or docstring informing users that supplied content and identifiers will be sent to an external service.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% 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_card_sender.py (reported line 28)May include surrounding context.

python
def get_token(self):
        url = "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal"
        resp = requests.post(url, json={"app_id": self.app_id, "app_secret": self.app_secret})
        result = resp.json()
        if result.get("code") == 0:
            self._token = result.get("tenant_access_token")

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% 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_card_sender.py (reported line 58)May include surrounding context.

python
def get_token(self):
        url = "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal"
        resp = requests.post(url, json={"app_id": self.app_id, "app_secret": self.app_secret})
        result = resp.json()
        if result.get("code") == 0:
            self._token = result.get("tenant_access_token")

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The CLI advertises support for user_id, but the implementation silently coerces every non-chat_id recipient type to open_id. This can cause messages to be sent to the wrong identity namespace or fail unpredictably, undermining operator expectations and potentially disclosing message contents to unintended recipients if identifiers overlap or are mishandled.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

Natural-language content in titles, messages, and examples consistently assumes Chinese usage, while the skill description does not state that it is China-specific or provide an opt-in language/locale choice. This can violate language or locale policy when skills implicitly force a specific language for outputs or user interaction.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code sets the default dropdown placeholder to "请选择", forcing a specific language in the generated card content. The file does not provide any opt-in, locale selection, or documented region-specific justification for this language choice.

Content

No source excerpt is available for this finding.