Back to skill

Security audit

Feishu Cli Export

Security checks for vulnerabilities and agentic risk

Overview

The skill is mainly a Feishu document exporter, but it also documents an unexpected local-file upload/import workflow and under-scoped shell/token handling that users should review carefully.

Install only if you are comfortable granting the agent Feishu document access and local file write/read behavior. Treat exported Markdown, PDFs, Word files, images, and cached tokens as sensitive. Avoid using this export skill for any local-file import or upload workflow unless that capability is explicitly desired and confirmed.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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

Error
Location
SKILL.md:52
Finding

Shell Command Injection Through Unvalidated Invocation Arguments

Content
View full analysis
--output ``` ```bash feishu-cli wiki export --output ``` Related retry logic: ```bash sleep 5 && feishu-cli doc export ``` ### Technical Analysis The skill authorizes the `Bash` tool and instructs the agent to interpolate document IDs, node tokens, URLs, and output paths directly into shell command strings. It does not require strict input validation, safe shell quoting, argument-array execution, or rejection of shell metacharacters. If the agent replaces these placeholders through direct string construction, characters such as command separators, command substitutions, redirections, or newlines may be interpreted by the shell rather than passed to `feishu-cli` as literal argument content. Document identifiers and node tokens have predictable formats and can be validated using an allowlist. Output paths also require canonicalization and quoting. The absence of these controls makes command injection possible in implementations that follow the documented command templates literally. ### Attack Path 1. An attacker supplies a crafted document identifier, node token, URL, or output path containing shell syntax. 2. The agent substitutes that value into one of the documented Bash command templates. 3. The Bash interpreter parses the injected metacharacters as shell syntax. 4. The attacker's additional command executes with the same operating-system identity and tool permissions as the agent. 5. The injected process can access any local resources available to that identity, including configuration files and Feishu credentials. ### Impact Assessment Successful exploitation could provide arbitrary command execution under the agent's o ...[truncated 618 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:314
Finding

Export-Only Skill Includes an Unrelated Local File Upload Workflow

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
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (7)

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The document front matter says import from local DOCX should use another skill, yet later instructions tell the current skill how to execute imports. Contradictory guidance is dangerous in agent settings because routing and policy decisions often depend on the declared scope of the skill; hidden or conflicting capabilities can bypass expected safeguards and lead to unauthorized data upload.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

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

md
| --front-matter | 添加 YAML front matter(标题和文档 ID) | 否 |
| --highlight | 保留文本颜色和背景色(输出为 HTML `<span>` 标签) | 否 |
| --expand-mentions | 展开 @用户为友好格式(需要 contact:user.base:readonly 权限) | 是(默认开启) |
| --user-access-token | User Access Token(用于访问无 App 权限的文档,未指定时自动从 `auth login` 读取) | 自动读取 |

## 支持的 URL 格式

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

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

md
| --front-matter | 添加 YAML front matter(标题和文档 ID) | 否 |
| --highlight | 保留文本颜色和背景色(输出为 HTML `<span>` 标签) | 否 |
| --expand-mentions | 展开 @用户为友好格式(需要 contact:user.base:readonly 权限) | 是(默认开启) |
| --user-access-token | User Access Token(用于访问无 App 权限的文档,未指定时自动从 `auth login` 读取) | 自动读取 |

## 支持的 URL 格式

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill metadata and opening description state that this skill is dedicated to export operations and explicitly tell users to use a different skill for local DOCX import, but later sections document how to import local files into Feishu using this same skill. This scope mismatch can cause an agent to perform unintended write/create operations against Feishu when the user or policy expected read/export-only behavior, undermining least privilege and safety assumptions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill explains that exported content is written to local files and defaults to /tmp, but it does not explicitly warn that document contents may contain sensitive data and will persist on disk outside Feishu. Temporary directories are often accessible to other local processes or retained longer than users expect, creating confidentiality and data lifecycle risks.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The skill instructs use of app credentials and user tokens, including automatic reading of saved tokens, but does not give an explicit warning about sensitive credential handling, exposure in shell history, logs, or accidental disclosure in outputs. In an agent environment, this increases the chance that secrets are mishandled or requested unsafely, especially when examples show direct token usage on the command line.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill strongly encourages downloading embedded images locally and reading them for analysis, but omits any privacy warning that images may contain sensitive personal, business, or regulated information. This expands the data footprint from cloud-only content to local files and may lead to unnecessary collection and retention of images not needed for the user’s task.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.