Back to skill

Security audit

飞书文档API技能

Security checks for vulnerabilities and agentic risk

Overview

This Feishu document skill does what it advertises, but it can delete or overwrite shared documents and expose app secrets through CLI arguments without strong safeguards.

Install only if you are comfortable giving this skill Feishu app credentials with read/write access to documents. Use a least-privileged Feishu app, avoid passing secrets with --app-secret, prefer protected environment configuration, test in a non-production folder first, and manually confirm document IDs before delete or full-replace operations.

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
bin/cli.js:40
Finding

Feishu App Secret Exposed Through Command-Line Arguments

Content
View full analysis
', '飞书应用ID(覆盖环境变量)') .option('--app-secret ', '飞书应用密钥(覆盖环境变量)') .action(async (options) => { try { if (options.appId) process.env.FEISHU_APP_ID = options.appId; if (options.appSecret) process.env.FEISHU_APP_SECRET = options.appSecret; ``` Equivalent `--app-secret` handling is repeated across every major CLI command. ### Technical Analysis The CLI permits the Feishu App Secret to be supplied directly as a command-line argument. Command-line arguments are not an appropriate secret transport mechanism because they can be exposed through: - Shell history files. - Process listings and operating-system process inspection interfaces. - Terminal session logging. - Job schedulers, command auditing, and monitoring platforms. - Diagnostic reports that capture process command lines. Copying the secret from `options.appSecret` into `process.env.FEISHU_APP_SECRET` does not remove it from `process.argv`, the parent shell's history, or external process telemetry. The secret grants application-level authentication through Feishu's tenant access-token endpoint. Its effective authority is determined by the permissions granted to the associated Feishu application. ### Attack Path 1. A user invokes a command such as: ```bash node bin/cli.js get \ --document-id dcnxxxxxx \ --app-id cli_xxxxxx \ --app-secret real_secret_value ``` 2. The complete command is recorded in shell history or remains visible in process metadata while the command runs. 3. A local user, process-monitoring agent, log collector, or party with access to the user's shell history obtains the secret. 4 ...[truncated 834 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
package-lock.json:23
Finding

Dependency Lockfile Uses a Third-Party npm Registry Mirror

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
Findings (42)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SETUP.md (reported line 59)May include surrounding context.

方法A:使用.env文件(推荐)

bash
cd skills/feishu-docs
cp .env.example .env
# 编辑.env文件,填入你的凭证

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

从给出的代码块看,实际行为集中在“测试飞书文档转换接口”。脚本读取环境变量中的 appId/appSecret,实例化 FeishuDocsAPI,并调用 convertContent('markdown', ...) 与 convertContent('html', ...) 来验证转换结果,同时测试非法类型、空内容的报错处理,以及检查表格块中 merge_info 字段。代码没有展示任何创建文档、读取文档、更新文档、删除文档或权限管理相关操作。因此,虽然声明中的“支持 Markdown/HTML 内容转换”与代码行为一致,但整体描述将技能定义为完整的飞书文档 CRUD + 权限管理 API,与当前代码块实际体现的能力不符,属于描述与行为不一致。

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 38)May include surrounding context.

md
node bin/cli.js --help

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node bin/cli.js --help

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node bin/cli.js --help

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node bin/cli.js --help

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node bin/cli.js --help

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node bin/cli.js --help

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node bin/cli.js --help

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% 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 · SKILL.md (reported line 135)May include surrounding context.

md
GET    /docx/v1/documents/{document_id}/raw_content          # 获取文档纯文本
GET    /docx/v1/documents/{document_id}/blocks               # 获取文档块列表
PATCH  /docx/v1/documents/{document_id}/blocks/{block_id}    # 更新块
DELETE /docx/v1/documents/{document_id}/blocks/{block_id}    # 删除块
POST   /docx/v1/documents/{document_id}/blocks/{block_id}/children  # 插入子块
POST   /docx/v1/documents/blocks/convert                     # Markdown/HTML→块
DELETE /drive/v1/files/{file_token}?type=docx                # 删除文档

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
81% confidence
Finding

Document-level deletion is a high-risk destructive capability, and the skill exposes it without describing guardrails such as confirmation, token validation, or rollback/version recovery expectations. In an agent-driven workflow, a mistaken or manipulated file_token could cause permanent deletion of the wrong document, making this materially more dangerous than ordinary read/write operations.

Content

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

md
DELETE /docx/v1/documents/{document_id}/blocks/{block_id}    # 删除块
POST   /docx/v1/documents/{document_id}/blocks/{block_id}/children  # 插入子块
POST   /docx/v1/documents/blocks/convert                     # Markdown/HTML→块
DELETE /drive/v1/files/{file_token}?type=docx                # 删除文档
GET    /drive/v1/files?folder_token=xxx                      # 列出文件夹文件
POST   /drive/v1/permissions/{token}/members?type=docx       # 添加权限成员
GET    /drive/v1/permissions/{token}/members?type=docx       # 获取权限成员

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% 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 · example-usage.md (reported line 67)May include surrounding context.

md
### 订单管理
- GET /api/orders
- POST /api/orders
- DELETE /api/orders/{id}

## 代码示例

Known Vulnerable Dependency: axios==1.13.5 — 16 advisory(ies): CVE-2026-44494 (axios Vulnerable to Full Man-in-the-Middle via Prototype Pollution Gadget in `co); CVE-2026-44495 (axios Vulnerable to Credential Theft and Response Hijacking via Prototype Pollut); CVE-2025-62718 (Axios has a NO_PROXY Hostname Normalization Bypass that Leads to SSRF) +13 more

High
Category
Supply Chain
Confidence
95% confidence
Finding

The lockfile pins axios to 1.13.5, and the static analysis indicates multiple published advisories affecting that version, including SSRF/proxy bypass and prototype-pollution-related attack paths. In a skill that performs remote document API operations, an HTTP client library is security-sensitive, so exploitable flaws could affect outbound request routing, credential handling, or response trust.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: form-data==4.0.5 — 1 advisory(ies): CVE-2026-12143 (form-data: CRLF injection in form-data via unescaped multipart field names and f)

High
Category
Supply Chain
Confidence
89% confidence
Finding

form-data 4.0.5 is flagged for CRLF injection via unescaped multipart field names and filenames. If this skill ever builds multipart requests using attacker-controlled input, an attacker may be able to manipulate part headers or request structure, which can enable request smuggling-like behavior or downstream parsing abuses.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: axios==1.13.5 — 16 advisory(ies): CVE-2026-44494 (axios Vulnerable to Full Man-in-the-Middle via Prototype Pollution Gadget in `co); CVE-2026-44495 (axios Vulnerable to Credential Theft and Response Hijacking via Prototype Pollut); CVE-2025-62718 (Axios has a NO_PROXY Hostname Normalization Bypass that Leads to SSRF) +13 more

High
Category
Supply Chain
Confidence
96% confidence
Finding

This package allows installation of axios versions matched by ^1.6.0, and the static finding indicates the resolved version is axios 1.13.5 with multiple known advisories, including SSRF- and request-handling-related issues. In a document API skill that performs outbound HTTP requests, vulnerable axios behavior can materially increase risk because attacker-controlled URLs, proxy settings, headers, or polluted objects may influence request routing, credential handling, or response processing.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This markdown file includes a delete command example that removes a document, but the surrounding documentation provides no warning that the action may be destructive or irreversible. Under the markdown criteria for SQP-2, user-facing skill documentation should disclose behaviors that can affect user data or system integrity.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · SETUP.md (reported line 44)May include surrounding context.

方法B:手动安装

bash
# 创建技能目录
mkdir -p /Users/steven/openclaw/skills/feishu-docs
cd /Users/steven/openclaw/skills/feishu-docs

# 复制所有文件到目录

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · SETUP.md (reported line 44)May include surrounding context.

方法B:手动安装

bash
# 创建技能目录
mkdir -p /Users/steven/openclaw/skills/feishu-docs
cd /Users/steven/openclaw/skills/feishu-docs

# 复制所有文件到目录

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill declares environment-variable requirements for application credentials but does not declare any explicit tool scope or allowed-tools boundary. That makes the skill's effective privileges under-specified, which is dangerous for an agent skill because secret access and external API use can occur without a clear least-privilege contract.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill prominently advertises destructive operations such as document deletion and full-content replacement without an explicit warning about irreversibility or user confirmation guidance. In an agent context, that increases the chance of accidental destructive actions against production documents when a user intent is ambiguous or parameters are mistaken.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This code file includes a destructive operation via the delete command, culminating in api.deleteDocument(options.documentId). Although it logs that deletion is in progress, there is no confirmation prompt or stronger user-facing warning that the action is irreversible, which increases the risk of accidental data loss.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The manifest describes a skill for creating, reading, updating, deleting Feishu documents, converting Markdown/HTML content, and managing document permissions. This file additionally implements workspace discovery features: searching documents globally and listing arbitrary folder contents, which are broader content-enumeration operations not described as part of the skill’s stated purpose.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The examples instruct users to export and use live Feishu app credentials directly in the shell, but provide no guidance on secret handling, shell history exposure, log leakage, or avoiding committed/shared files. In an agent or shared workstation context, this increases the chance that sensitive credentials are exposed and then used to access or modify Feishu workspace data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The documented commands create documents and write content to a remote Feishu workspace, but the examples do not clearly warn users that running them has external side effects. In agent-assisted or automated environments, this can lead to unintended document creation, data propagation to third-party systems, or modification of production/shared workspaces.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

replaceDocumentContent irreversibly deletes all existing child blocks before inserting new content, with no safeguard in the API contract such as confirmation, dry-run support, or expected-state checks. In an agent setting, ambiguous prompts, misuse, or prompt injection into higher-level orchestration could cause destructive overwrite of documents the token can access.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.