Back to skill

Security audit

feishu-lark-cli

Security checks for vulnerabilities and agentic risk

Overview

This Lark messaging skill is mostly purpose-aligned, but it installs an unpinned executable CLI and grants broad chat-reading and chat-changing abilities that need careful review.

Install only if you trust the @larksuite/cli npm package and the Lark app credentials you will expose to it. Use the narrowest Lark scopes possible, prefer dry-run before writes, confirm recipients/content/identity before sending or mutating chats, avoid broad or exhaustive chat searches unless authorized, and be cautious with Markdown containing remote images because those URLs may be fetched and uploaded by the CLI.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
references/lark-im-messages-send.md:40
Finding
Unrestricted Remote Markdown Image Retrieval<![CDATA[ ## Vulnerability Details **File Location**: `references/lark-im-messages-send.md:40-69`; equivalent behavior is documented in `references/lark-im-messages-reply.md:40-69` **Vulnerability Type**: Server-Side Request Forgery and unintended data transfer **Risk Level**: Medium ### Vulnerable Code Snippet ```markdown ## What `--markdown` Really Does `--markdown` is **not** sent as raw Markdown API content. The shortcut does all of the following before sending: 1. Forces `msg_type=post` 2. Resolves remote Markdown images like `![x](https://...)` by downloading and uploading them first 3. Normalizes the Markdown for Feishu post rendering 4. Wraps the result as: ```json {"zh_cn":{"content":[[{"tag":"md","text":"..."}]]}} ``` This means `--markdown` is convenient, but it is not a full-fidelity Markdown transport. ### Current Markdown Caveats - It does **not** promise full CommonMark / GitHub Flavored Markdown support. - It always becomes a `post` payload with a single `zh_cn` locale. - It does **not** let you set a `post` title. If you need a title, use `--msg-type post --content ...`. - Headings are rewritten: - `# Title` becomes `#### Title` - `##` to `######` are normalized to `#####` when the content contains H1-H3 - Consecutive headings are separated with blank lines after heading normalization. - Block spacing and line breaks may be normalized during conversion. - Code blocks are preserved as code blocks. - Excess blank lines are compressed. - Only `http://...`, `https://...`, or already-uploaded `img_xxx` Markdown images are kept reliably. - Local paths in Markdown image syntax like `![x](./a.png)` are **not** auto-uploaded by `--markdown`; they may be stripped during optimization. - If remote Markdown image download/upload fails, that image is removed with a warning. ``` The reply workflow documents the same behavior: ```markdown 2. Resolves remote Markdown images like `![x](https://...)` ``` and: ```markdown - Only remote `http:/ ...[truncated 2929 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Disable automatic remote-image retrieval by default. 2. Require explicit confirmation that identifies every remote URL before downloading and uploading it. 3. Prefer requiring users to download and inspect remote media separately before attaching it. 4. Permit only HTTPS unless an explicitly approved exception is required. 5. Resolve hostnames before connection and reject loopback, private, link-local, multicast, unspecified, and reserved addresses for both IPv4 and IPv6. 6. Repeat destination validation after every redirect and DNS resolution. 7. Block known cloud metadata destinations and metadata hostnames. 8. Set strict connection, read, total-duration, redirect-count, response-size, and decompressed-size limits. 9. Validate the response MIME type and file signature against an allowlist of supported image formats. 10. Do not forward ambient credentials, cookies, proxy authorization, or Lark tokens to remote image servers. 11. Log the original URL, final resolved destination, response size, and upload destination without recording credentials or sensitive response content. 12. Add equivalent controls to both `+messages-send` and `+messages-reply`. ]]>

T08 · Insecure Dependencies

Warning
Location
SKILL.md:5
Finding
Unpinned Executable npm Dependency<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:5-6` **Vulnerability Type**: Unpinned third-party executable dependency **Risk Level**: Medium ### Vulnerable Code Snippet ```yaml homepage: https://github.com/larksuite/cli metadata: {"clawdbot":{"emoji":"💬","requires":{"bins":["lark-cli"]},"install":[{"id":"node","kind":"node","package":"@larksuite/cli","bins":["lark-cli"],"label":"Install lark-cli (npm)"}]},"openclaw":{"emoji":"💬","requires":{"bins":["lark-cli"]},"install":[{"id":"node","kind":"node","package":"@larksuite/cli","bins":["lark-cli"],"label":"Install lark-cli (npm)"}]}} ``` ### Technical Analysis The installation metadata requests `@larksuite/cli` without an exact version, lockfile, integrity hash, or other immutable package reference. Consequently, separate installations of the same reviewed Skill may resolve to different CLI releases. This dependency is security-sensitive because the Skill delegates its effective implementation to `lark-cli`. The CLI handles: - User and tenant access tokens. - Authenticated Lark API traffic. - Reading and uploading local files. - Downloading remote Markdown images. - Reading and searching private chat content. - Sending messages as a user or bot. A future compromised, malicious, or incompatible package release could therefore change the Skill’s behavior without any change to the audited project files. The audit found no evidence that the current package is malicious; the issue is the lack of reproducible dependency pinning and integrity verification. ### Attack Path 1. The npm package, a maintainer account, publishing pipeline, or registry delivery path is compromised, or a future release introduces unsafe behavior. 2. An environment installs the Skill after the affected release becomes the version selected by npm. 3. Because no exact version or integrity value is specified, the installation resolves the changed package. 4. The agent runs `lark-cli` for a normal IM operation. 5. The unr ...[truncated 993 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pin `@larksuite/cli` to an audited exact version rather than an unconstrained package name. 2. Record and verify the package integrity hash during installation. 3. Use a committed lockfile or equivalent immutable dependency manifest where the Skill platform supports it. 4. Verify npm package provenance and publisher identity. 5. Review the source and packaged artifact for the pinned release, particularly authentication, file upload, URL retrieval, and token-handling paths. 6. Upgrade only through an explicit review process rather than automatically resolving the latest package. 7. Run the CLI with the minimum filesystem, network, and credential access required for each operation. 8. Separate user-token and bot-token operations where practical, and avoid exposing both credentials to commands that require only one identity. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (18)

Credential Access

High
Category
Privilege Escalation
Content
- When using `--video`, `--video-cover` is required as the video cover
- `--dry-run` uses placeholder image keys for remote Markdown images and placeholder media keys for local uploads
- Failures return an error code and message
- `--as user` uses a user access token (UAT) and requires the `im:message.send_as_user` and `im:message` scopes; the message is sent as the authorized end user
- `--as bot` uses a tenant access token (TAT) and requires the `im:message:send_as_bot` scope
- When sending as a bot, the app must already be in the target group or already have a direct-message relationship with the target user
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
- When using `--video`, `--video-cover` is required as the video cover
- `--dry-run` uses placeholder image keys for remote Markdown images and placeholder media keys for local uploads
- Failures return an error code and message
- `--as user` uses a user access token (UAT) and requires the `im:message.send_as_user` and `im:message` scopes; the message is sent as the authorized end user
- `--as bot` uses a tenant access token (TAT) and requires the `im:message:send_as_bot` scope
- When sending as a bot, the app must already be in the target group or already have a direct-message relationship with the target user
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
- When using `--video`, `--video-cover` is required as the video cover
- `--dry-run` uses placeholder image keys for remote Markdown images and placeholder media keys for local uploads
- Failures return an error code and message
- `--as user` uses a user access token (UAT) and requires the `im:message.send_as_user` and `im:message` scopes; the message is sent as the authorized end user
- `--as bot` uses a tenant access token (TAT) and requires the `im:message:send_as_bot` scope
- When sending as a bot, the app must already be in the target group or already have a direct-message relationship with the target user
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
- When using `--video`, `--video-cover` is required as the video cover
- `--dry-run` uses placeholder image keys for remote Markdown images and placeholder media keys for local uploads
- Failures return an error code and message
- `--as user` uses a user access token (UAT) and requires the `im:message.send_as_user` and `im:message` scopes; the message is sent as the authorized end user
- `--as bot` uses a tenant access token (TAT) and requires the `im:message:send_as_bot` scope
- When sending as a bot, the app must already be in the target group or already have a direct-message relationship with the target user
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Context Leakage

High
Category
Data Exfiltration
Content
# Step 1: Fetch group messages and find one that contains thread_id
lark-cli im +chat-messages-list --chat-id oc_xxx

# Step 2: Extract thread_id from the JSON output and fetch thread replies
lark-cli im +threads-messages-list --thread omt_xxx
```
Confidence
75% confidence
Finding
Code or instructions that leak agent conversation context to external services, potentially exposing sensitive user interactions.

Description-Behavior Mismatch

Medium
Confidence
88% confidence
Finding
The manifest describes sending/replying, searching chat history, managing group members, uploading/downloading files, and managing reactions. But this skill file also exposes APIs for recalling messages, forwarding and merge-forwarding messages, querying message read-users, and creating/deleting/listing pinned messages, which are materially broader IM operations than the manifest states.

Missing User Warnings

Medium
Confidence
89% confidence
Finding
This skill enables externally impactful actions such as sending messages, modifying chats, adding/removing members, downloading files, and other communication-affecting operations, but it does not present an explicit user-facing warning or confirmation model at the description layer. In an agent context, that increases the risk of unintended outbound communication, privacy-impacting data access, or destructive chat operations being triggered without the user appreciating the consequences.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
This skill enables retrieval of full conversation histories, which can expose sensitive personal, business, or regulated data, yet it does not prominently warn operators to verify authorization, necessity, and privacy implications before use. Because the command is optimized for easy message inspection across group chats and direct messages, an agent could over-collect or disclose chat content beyond the user's legitimate need.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The skill explicitly enables batch retrieval of full message contents and sender identities, which are inherently sensitive communications data, but it does not include a clear privacy warning, authorization check reminder, or usage boundary for handling personal or confidential content. In an agent setting, this omission can normalize broad access to private conversations and increase the risk of over-collection, unnecessary disclosure, or misuse of message data.

Natural-Language Policy Violations

Medium
Confidence
92% confidence
Finding
The documentation states that `--markdown` always becomes a `post` payload with a single `zh_cn` locale. This is a natural-language locale policy concern because it imposes a specific locale on generated content without describing user choice or opt-in.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
> **Prerequisite:** Read [`../lark-shared/SKILL.md`](../../lark-shared/SKILL.md) first to understand authentication, global parameters, and safety rules.

Search Feishu messages across conversations. This shortcut automatically performs a multi-step workflow: search for message IDs, batch fetch message details, then enrich the results with chat context.

> **User identity only** (`--as user`). Bot identity is not supported.
Confidence
80% confidence
Finding
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
> **Prerequisite:** Read [`../lark-shared/SKILL.md`](../../lark-shared/SKILL.md) first to understand authentication, global parameters, and safety rules.

Search Feishu messages across conversations. This shortcut automatically performs a multi-step workflow: search for message IDs, batch fetch message details, then enrich the results with chat context.

> **User identity only** (`--as user`). Bot identity is not supported.
Confidence
80% confidence
Finding
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
> **Prerequisite:** Read [`../lark-shared/SKILL.md`](../../lark-shared/SKILL.md) first to understand authentication, global parameters, and safety rules.

Search Feishu messages across conversations. This shortcut automatically performs a multi-step workflow: search for message IDs, batch fetch message details, then enrich the results with chat context.

> **User identity only** (`--as user`). Bot identity is not supported.
Confidence
80% confidence
Finding
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
> **Prerequisite:** Read [`../lark-shared/SKILL.md`](../../lark-shared/SKILL.md) first to understand authentication, global parameters, and safety rules.

Search Feishu messages across conversations. This shortcut automatically performs a multi-step workflow: search for message IDs, batch fetch message details, then enrich the results with chat context.

> **User identity only** (`--as user`). Bot identity is not supported.
Confidence
80% confidence
Finding
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
The skill explicitly supports searching messages across conversations, fetching full message bodies in batch, and enriching them with chat context, but it does not pair this capability with an explicit privacy/minimization warning. That increases the risk that an agent or user will over-collect sensitive chat data, including private discussions, attachments metadata, and participant context, beyond what is necessary for the stated task.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The guidance to 'always paginate exhaustively' for summaries encourages systematic collection of all matching messages without balancing that advice with data-minimization or consent considerations. In a messaging context, exhaustive pagination can materially increase exposure of sensitive or irrelevant content and makes mass extraction for profiling, surveillance, or overbroad reporting easier.

Natural-Language Policy Violations

Medium
Confidence
90% confidence
Finding
The file explicitly says markdown content is always wrapped as a `post` payload with a single `zh_cn` locale. This is a language/locale constraint presented as fixed behavior, and the document does not offer user opt-in, alternatives for locale selection within this path, or justify the restriction as region-specific.

Missing User Warnings

Medium
Confidence
87% confidence
Finding
The document includes a raw delete operation for message reactions without any warning that it is destructive or guidance to confirm user intent before invoking it. In an agent skill context, this increases the chance of unintended state-changing actions against chat content, especially if the agent translates ambiguous user requests directly into API calls.

Static analysis

No suspicious patterns detected.