Back to skill

Security audit

feishu-card-sender

Security checks for vulnerabilities and agentic risk

Overview

The skill is for Feishu card messaging and its network behavior is mostly purpose-aligned, but it gives unsafe guidance for handling Feishu app secrets.

Review before installing. Use this only with a Feishu app restricted to the minimum required permissions, and do not store the App Secret in USER.md or pass it on the command line. Prefer a protected secret mechanism or tightly scoped environment variable, avoid uploading sensitive images or message content unless approved, and rotate the App Secret if it has already been placed in documentation, shell history, logs, or shared agent context.

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:46
Finding
Feishu application secret exposed through plaintext documentation and command-line arguments<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:10-17`; `scripts/upload_image.py:46-48` **Vulnerability Type**: Plaintext credential storage and command-line secret exposure **Risk Level**: Medium ### Relevant Code The documentation instructs users to place the Feishu App ID and App Secret directly in `USER.md`: ```markdown Configure the Feishu application credentials in USER.md: - **Feishu App ID:** cli_xxx - **Feishu App Secret:** xxx ``` The upload script also accepts the application secret as a command-line argument: ```python parser = argparse.ArgumentParser(description="Upload an image to Feishu") parser.add_argument("--image", required=True, help="Image path") parser.add_argument("--app-id", default=APP_ID, help="Feishu App ID") parser.add_argument("--app-secret", default=APP_SECRET, help="Feishu App Secret") args = parser.parse_args() ``` ### Technical Analysis The Skill recommends storing a long-lived Feishu application secret as plaintext in `USER.md`. Any agent, extension, backup process, synchronization service, or local user with access to that file or its surrounding user context may consequently obtain the credential. The script independently supports passing the same secret through `--app-secret`. Command-line arguments can be exposed through process-inspection interfaces, monitoring agents, diagnostic reports, shell history, terminal logs, and automation logs. This exposure is unnecessary because the script already supports `FEISHU_APP_SECRET` as an environment variable. The documented configuration is also inconsistent with the implementation: the script does not read `USER.md`. This inconsistency may encourage users or automation authors to copy the secret into additional files or command lines while troubleshooting. The transmission of the App ID and App Secret to Feishu's official authentication endpoint is necessary for the declared image-upload functionality. The identified risk concerns local credential handli ...[truncated 1435 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove the `--app-secret` command-line option so the secret cannot be supplied through process arguments: ```python app_secret = os.environ.get("FEISHU_APP_SECRET") if not app_secret: raise RuntimeError("FEISHU_APP_SECRET must be configured securely") ``` 2. Do not instruct users to store credentials in `USER.md`, project documentation, source-controlled files, or other agent-readable context. 3. Obtain the secret from a dedicated secret manager where available. If environment variables must be used, inject them only into the upload process and avoid printing or logging the environment. 4. Validate that both the App ID and App Secret are present before making a network request. Return a generic configuration error without including secret values. 5. Ensure exception handling never prints request headers, authentication payloads, environment variables, or access tokens. 6. Restrict the Feishu application to the minimum permissions required for image upload and message delivery. Periodically review granted permissions and remove unnecessary scopes. 7. Rotate the App Secret after remediation if it has previously appeared in `USER.md`, shell history, logs, process captures, or source control. 8. Update the documentation to describe secure secret provisioning accurately and consistently with the implementation. ]]>
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 (8)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The documented behavior is inconsistent: the description says the skill uses the `message` tool with a card parameter, but the findings indicate direct Feishu API usage and undeclared image-upload behavior. This mismatch undermines user trust and reviewability, because operators may approve a simple messaging skill while it actually performs different external actions and credential-handling flows.

Lp3

Medium
Category
MCP Least Privilege
Confidence
73% confidence
Finding
The skill declares no explicit tool scope or permissions while its documented workflow implies access to credentials, external network calls, and image upload behavior. Missing scope declarations make it harder to constrain what the skill may access or transmit, increasing the risk of over-privileged execution or unintended data exposure.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
The skill encourages sending messages and uploading images to Feishu but does not warn users that message content and media will leave the local environment and be transmitted to an external service. This can cause accidental disclosure of sensitive text, images, or metadata when users assume the action is local or insufficiently understand the data-sharing implications.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The skill instructs users to place a Feishu App Secret in configuration without any guidance on secure secret storage, least exposure, or rotation. That creates a realistic risk of credential leakage through plaintext files, logs, screenshots, repository commits, or broader agent access to the configuration.

External Transmission

Medium
Category
Data Exfiltration
Content
url = "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal"
    headers = {"Content-Type": "application/json; charset=utf-8"}
    data = {"app_id": app_id, "app_secret": app_secret}
    resp = requests.post(url, headers=headers, json=data)
    result = resp.json()
    
    if result.get("code") != 0:
Confidence
80% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
This code performs a network transmission of user-provided file data to an external service, but the script does not present any confirmation prompt or explicit user-facing warning at runtime beyond the generic argument descriptions. For code files, network calls that transmit user data should have some visible disclosure unless clearly covered by the skill description, which is not present here.

Natural-Language Policy Violations

Low
Confidence
89% confidence
Finding
The module docstring and CLI help text are written in Chinese, which imposes a single language for user-facing interaction without any opt-in or alternative. The policy specifically calls out language or locale constraints as violations when they are forced without user choice or clear justification.

Missing User Warnings

Low
Confidence
80% confidence
Finding
The code accesses FEISHU_APP_ID and FEISHU_APP_SECRET from the environment, which are sensitive values, but only includes a brief internal comment and no user-facing notice. Under this rule, sensitive environment variable access should have visible disclosure in code comments/docstrings or runtime messaging unless already clearly documented elsewhere.

Static analysis

No suspicious patterns detected.