Back to skill

Security audit

feishu-mention

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it claims, but it uses Feishu app secrets and group-member data in ways users should review before installing.

Install only if you are comfortable with the skill reading Feishu app credentials from OpenClaw config, querying Feishu for bot and chat-member identity data, and caching that data locally. Avoid sharing debug output or openclaw.json contents, restrict Feishu app permissions, and prefer a version that lazily uses only the selected account, hardens cache file permissions, and escapes generated XML.

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

T09 · Insecure Skill Coding Practices

Warning
Location
index.js:51
Finding

Import-Time Authentication Uses Every Configured Feishu Account

Content
View full analysis
log('ERROR', 'Failed to ensure bot infos:', err.message)); ``` ```javascript // Fetch from API // We only need to fetch for accounts that have credentials const promises = Object.entries(this.accountsConfig).map(async ([accountId, config]) => { if (!config.appId || !config.appSecret) return null; try { const token = await this._getTenantAccessToken(config.appId, config.appSecret); if (!token) return null; const res = await fetch('https://open.feishu.cn/open-apis/bot/v3/info', { headers: { 'Authorization': `Bearer ${token}` } }); const data = await res.json(); if (data.code === 0 && data.bot) { return { name: data.bot.app_name, open_id: data.bot.open_id, appId: config.appId, accountId: accountId }; } } catch (e) { log('ERROR', `Failed to fetch bot info for ${accountId}:`, e.message); } return null; }); ``` ```javascript async _getTenantAccessToken(appId, appSecret) { const cache = this.tokenCache.get(appId); if (cache && Date.now() < cache.expireTime) { return cache.token; } try { const response = await fetch('https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal', { method: 'POST', headers: { 'Content-Type': 'application/json; charset=utf-8' }, body: JSON.stringify({ app_id: appId, app_secret: appSecret }) }); const data = await response.json(); if (data.code === 0) { const expireTime = Date.now() + (data.expire - 300) * 1000; this.tokenCache.set(appId, { token: data.tenant_access_token, expireTime }); return data.tenant_acc ...[truncated 2415 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
index.js:299
Finding

Feishu Directory Data Is Cached Without Explicit Filesystem Protection

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
index.js:206
Finding

Unescaped Values Are Inserted into Feishu XML Mention Tags

Content
View full analysis
${name}`; } ``` ### Technical Analysis The function inserts `openId` into a quoted XML attribute and `name` into an XML text node without contextual escaping or identifier validation. Member names can originate from Feishu API responses or cached member data. Aliases and direct calls to the exported `FeishuMentionResolver` class can also supply values that are not inherently trusted. A locally poisoned cache can provide both fields. XML metacharacters such as `&`, `<`, `>`, `"`, and `'` can therefore corrupt the generated tag or introduce additional markup. The attribute and text contexts require different escaping rules. The implementation currently performs neither. The `openId` should additionally be constrained to Feishu's expected identifier syntax rather than treated as arbitrary markup content. ### Attack Path 1. An attacker controls a member display name, a caller-provided mapping, or a locally cached member record. 2. The crafted record is selected during mention resolution. 3. `buildMentionTag()` interpolates the crafted `name` or `openId` directly into the XML string. 4. The resolved string is passed to a Feishu message-sending API. 5. The downstream markup parser receives malformed or attacker-altered XML, potentially changing the displayed message or introducing unintended markup elements. For example, a malicious value containing a quotation mark in `openId` can terminate the `user_id` attribute, while a name containing `<` or `&` can alter the text-node structure. ### Impact Assessment Successful exploitation can modify the structure or presentation of an outgoing Feishu message, create malformed mention tags, or cause an unintended identity or markup element to be interpreted by the do ...[truncated 180 chars]
Remediation
View remediation
` to `>` 2. Escape attribute values before inserting `openId`, including `&`, `<`, `>`, `"`, and `'`. 3. Validate `openId` against the documented Feishu OpenID format and reject values containing whitespace or markup characters. 4. Validate data loaded from cache and API responses before passing it to `buildMentionTag()`. 5. Prefer a trusted serializer or structured message API over manual XML string concatenation where Feishu's API supports it. 6. Add tests covering names and identifiers containing quotation marks, angle brackets, ampersands, and malformed identifier values. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
assets/debug_guide.md:7
Finding

Debugging Guide Encourages Printing the Complete Credential Configuration

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • 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
Findings (25)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The documented purpose says the tool converts mentions into Feishu XML and should be used automatically before sending messages, but the analyzed behavior reportedly returns a different output format, adds undeclared cache-management features, and may require direct identifiers instead of using conversation context. This mismatch is dangerous because downstream agents may trust the skill's declared contract, then send malformed messages, leak identifiers, or invoke broader functionality than intended.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 56)May include surrounding context.

md
const { resolve } = require('./index.js');

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · assets/debug_guide.md (reported line 69)May include surrounding context.

md
**解决方案:**
*   确保 `openclaw.json` 正确。
*   尝试删除缓存文件 `rm ~/.openclaw/workspace/cache/feishu_mentions/bots_info.json` 强制刷新。

### 错误 2: 群成员解析失败

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill manifest requires converting mentions into Feishu/Lark XML before sending, but this resolver emits plain-text strings like '@name openid'. In a security-sensitive messaging workflow, that mismatch can silently break notification behavior and cause users or bots not to be notified, defeating the control the skill is supposed to enforce and enabling message delivery with incorrect semantics.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The README instructs users to store and use Feishu app credentials and to perform enterprise directory/member lookups, but it does not warn about protecting secrets, limiting credential exposure, or the privacy implications of resolving user identities from chat context. In an agent skill that automatically processes mentions before sending messages, this omission increases the chance that operators mishandle app secrets or perform unnecessary identity lookups without appropriate safeguards.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
84% confidence
Finding

The skill declares file and write requirements in metadata and its documented behavior implies network access, but it does not define a clear restrictive tool scope such as allowed-tools or equivalent permission boundaries. In an agent environment, this increases the blast radius by allowing a seemingly simple mention-formatting skill to read configuration, write cache files, and potentially call external APIs without transparent least-privilege constraints.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This markdown contains substantial usage, workflow, and API guidance only in Chinese, including the main description and parameter explanations. Because the skill does not offer an English/locale option or justify that it is intended only for Chinese-speaking users, it creates a natural-language locale constraint without user opt-in.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The documentation states that the tool automatically reads app credentials from local config and discovers bot OpenIDs, which extends behavior beyond pure text transformation into credential-backed enumeration of identities. That broader data access can surprise users and agents, and if misused could expose internal bot/account mappings or normalize over-privileged use of local secrets.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The guide explicitly instructs users to print ~/.openclaw/openclaw.json, which may contain sensitive credentials such as appSecret, and to inspect local cache files containing bot identifiers. In a debugging document for an agent skill, normalizing direct secret inspection without masking or caution increases the chance those values are copied into logs, terminals, screenshots, or support channels.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The file’s natural-language strings, comments, and example inputs are entirely in Chinese, including user-facing console output and sample text. This effectively constrains usage to a specific language without any opt-in or indication that the skill is intentionally region-specific.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

This code automatically uses configured Feishu app credentials to call remote APIs for bot info and later caches returned data to local JSON files, but there is no confirmation prompt or user-facing notice about the outbound requests or local persistence. The only visible messaging is internal error logging, which does not disclose the behavior to users before or during execution.

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 · index.js (reported line 138)May include surrounding context.

js
}

    try {
      const response = await fetch('https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json; charset=utf-8' },
        body: JSON.stringify({ app_id: appId, app_secret: appSecret })

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The resolver fetches full chat membership data from Feishu and stores it on disk in a user cache directory without any consent, minimization, or protection checks. In an agent setting, this expands access from the single mentioned name to the entire member list, creating unnecessary collection and local persistence of potentially sensitive identity data.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This markdown file presents all user-facing instructions in Chinese and does not indicate that the skill is region-specific or provide an opt-in language choice. Under the policy 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.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The module documentation explicitly says it replaces mentions with '@name openid' format, which conflicts with the skill metadata's required XML conversion behavior. This kind of documentation/implementation mismatch is dangerous because developers and agents may trust the code path as compliant and send malformed mentions, causing silent notification failures in a high-priority messaging tool.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The resolver persists chat member data locally for up to two hours under a user home directory, which may include names and open IDs. In shared, multi-user, or less-trusted agent environments, this creates unnecessary retention of potentially sensitive identity metadata and increases exposure if the host is compromised or the cache directory is accessible to other processes.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The test input string is explicitly written in Chinese and there is no indication that the skill offers language selection or that it is limited to a Chinese-specific context. This creates a natural-language policy concern because the file bakes in a specific locale without opt-in or justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

This markdown file contains user-facing instructional content only in Chinese, and it does not indicate that the skill is intentionally limited to Chinese-speaking users or a China-specific environment. Under the language/locale policy, forcing a specific language without opt-in can be a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file title and all instructional content are presented only in Chinese, which effectively forces a specific language on users. Under the stated policy, locale or language constraints should either be optional for users or clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

This markdown explains that the skill reads ~/.openclaw/openclaw.json for appId/appSecret values and later calls the Feishu API to retrieve group members. Although these actions are part of the feature description, the document does not explicitly warn users that the skill uses stored credentials and may access group membership data, which can affect privacy-sensitive information handling.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The natural-language instructions, feature descriptions, warnings, and usage guidance are all presented in Chinese, which effectively forces a specific language for users consuming the skill documentation. The file does not indicate an opt-in, alternative language, or a justified locale-specific scope.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

If mention resolution may query Feishu for group membership data but the skill description omits that, users and calling agents are not fully informed about external data access and potential privacy impact. Even if the behavior is legitimate, hidden network lookups of membership information violate transparency expectations and can cause inadvertent disclosure or policy violations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The debug guide recommends enabling verbose logging with DEBUG=true and shows sample output containing internal identifiers like bot open_id, then instructs users to inspect cached bot metadata. While this is useful for troubleshooting, it can expose operational identifiers in logs and local artifacts that may later be shared or retained insecurely.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The message payload is hard-coded to use the zh_cn locale and includes Chinese-language content without any indication that the user can choose another language or that the skill is intentionally region-specific. This matches the policy category for language or locale constraints that are not documented as optional or justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The file's docstrings, status messages, and examples are entirely in Chinese, indicating a fixed language/locale experience. There is no indication that users can opt into another language or that the Chinese-only behavior is a documented regional requirement.

Content

No source excerpt is available for this finding.