Back to skill

Security audit

Create Feishu Doc

Security checks for vulnerabilities and agentic risk

Overview

This skill needs review because it advertises real Feishu document creation, but its packaged script only simulates success and returns a Feishu-looking link.

Before installing, verify whether this skill has been changed to call a real authenticated Feishu API or tool and to fail clearly when creation cannot be verified. Use it only when you explicitly want content sent to Feishu, and avoid sensitive documents unless the upload destination, permissions, and verification behavior are clear.

Vulnerability Patterns
  • Tool Hijacking and SpoofingModifies or replaces tools so legitimate-looking calls execute attacker logic
  • 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)

T07 · Tool Hijacking and Spoofing

Warning
Location
scripts/create_feishu_doc.py:40
Finding

Feishu Operations Are Spoofed Through Fabricated Success Responses

Content
View full analysis

Vulnerability Details

File Location: scripts/create_feishu_doc.py:40-52, scripts/create_feishu_doc.py:144-156, and scripts/create_feishu_doc.py:299-307
Vulnerability Type: Tool and API spoofing
Risk Level: Medium

Vulnerable Code

Document creation is simulated instead of invoking Feishu:

python
# 这里应该调用实际的飞书API
# 伪代码:feishu_doc.create(title=self.title, content=self.initial_content)
print(f"📄 创建文档: {self.title}")
print(f"📝 初始内容: {self.initial_content[:50]}...")

# 模拟API调用
time.sleep(0.5)  # 模拟网络延迟

# 模拟返回结果
self.document_id = f"doc_{int(time.time())}"
self.document_url = f"https://feishu.cn/docx/{self.document_id}"

print(f"✅ 文档创建成功")
print(f"📋 文档ID: {self.document_id}")
print(f"🔗 文档链接: {self.document_url}")

return True, f"文档创建成功,ID: {self.document_id}"

Segment writes are also simulated:

python
# 这里应该调用实际的飞书API
# 伪代码:feishu_doc.append(doc_token=self.document_id, content=segment)
time.sleep(0.3)  # 模拟网络延迟

# 模拟API响应
if len(segment) > 1000 and retry == 0:
    # 模拟第一次失败(内容太长)
    raise Exception("Request failed with status code 400")

print(f"✅ 段落 {segment_index + 1} 写入成功")
return True, f"段落 {segment_index + 1} 写入成功"

Remote verification is likewise replaced with an unconditional simulated result:

python
# 这里应该调用实际的飞书API读取文档
# 伪代码:feishu_doc.read(doc_token=self.document_id)
time.sleep(0.5)  # 模拟网络延迟

# 模拟验证结果
print("✅ 文档验证完成")
print(f"🔗 文档链接: {self.document_url}")

return True, f"文档验证完成,链接: {self.document_url}"

Technical Analysis

The executable implementation does not invoke the documented feishu_doc.create, feishu_doc.append, or feishu_doc.read operations. Instead, it generates a timestamp-derived identifier, constructs a trusted-looking feishu.cn URL, and returns successful results without contacting Feishu.

The write routine similarly reports success without transmitting content. Its only simulated failure occurs for segments exceeding 1,000 characters on the first attempt, after which the ...[truncated 2174 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace each simulated operation with a real, authenticated integration:

    • Use feishu_doc.create or the official Feishu document creation API.
    • Use feishu_doc.append or the corresponding API for every segment.
    • Use feishu_doc.read to retrieve the completed remote document.
  2. Obtain the document identifier and URL exclusively from a validated Feishu response. Never construct a production URL from a locally generated timestamp.

  3. Validate API responses before returning success:

    • Confirm a successful HTTP or tool status.
    • Validate the response schema.
    • Require a nonempty remote document identifier.
    • Reject unexpected hosts or malformed document URLs.
  4. Implement genuine verification:

    • Read the document from Feishu after all writes.
    • Confirm that the remote document exists.
    • Compare expected segment counts, content hashes, or normalized content.
    • Return failure if any required content is absent.
  5. Fail securely when the integration is unavailable. Missing credentials, missing tools, network failures, malformed responses, and unsupported environments must produce explicit failure results rather than fabricated success.

  6. If simulation is intentionally retained for demonstrations or tests:

    • Move it into a separate test or example module.
    • Require an explicit --mock or equivalent option.
    • Clearly label every result and URL as simulated.
    • Use a nonproduction hostname such as example.invalid.
    • Prevent mock mode from being enabled by default.
  7. Add automated tests using a mocked API boundary. Tests should verify that failed creation, append, or read operations cannot produce a successful final result and that returned identifiers originate from the mocked remote response.

  8. Update README.md, SKILL.md, and package metadata so their behavior descriptions accurately match the executable implementation.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (8)

Vague Triggers

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The trigger description is excessively broad and captures generic document-writing requests, not just explicit requests to create or write to Feishu. In an agent environment, this can cause the skill to activate for ordinary content-generation tasks and unnecessarily transmit user content to an external Feishu API, increasing the risk of unintended data exfiltration and confused-deputy behavior.

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 file states that the skill was updated to add Chinese trigger words and to respond correctly to Chinese requests. Under the policy rule for all file types, language-specific behavior should not be forced unless the skill offers language choice or clearly documents a justified locale constraint; this changelog does not indicate either.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README states that the skill 'must' be used for essentially any request involving creating, writing, or organizing content into a Feishu document, including very broad categories like reports, notes, articles, and novels. This creates excessive trigger overlap with ordinary document-related tasks, increasing the chance the agent invokes this skill in situations where it is unnecessary or where a narrower, safer skill should be used, which can lead to unintended external document creation or data handling.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill does not warn users that their content will be sent to Feishu via API and stored on a third-party remote service. This weakens informed consent and can lead to accidental disclosure of sensitive, proprietary, or regulated information when the skill is triggered.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The manifest description mandates use of this skill for a very broad set of requests involving creating, writing, or organizing documents, including many generic content-generation scenarios. This can cause inappropriate auto-selection of the skill for ordinary document tasks, potentially exposing user content to external Feishu document creation flows when a narrower or local-only response would be safer.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script collects arbitrary document content from the user and is designed to send it to Feishu, but it provides no explicit consent flow, warning, or classification check before transmitting potentially sensitive data to an external service. In an agent-skill context, this is risky because users may assume the tool only formats content locally, while the skill description encourages use for PRDs, reports, notes, and other materials that often contain confidential business information.

Content

No source excerpt is available for this finding.

Scope Creep

Low
Category
Excessive Agency
Confidence
84% confidence
Finding

The phrase 'including but not limited to' signals scope creep and reinforces that the skill is intended to apply to an open-ended set of content types. In this context, that broad scope compounds the risk of inappropriate invocation and external sharing of content beyond what users may expect.

Content

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

md
---
name: create-feishu-doc
description: "Use this skill whenever the user wants to create, generate, write to, or organize content into a Feishu document. Triggers include: any mention of 'Feishu doc', 'Feishu document', '飞书文档', '创建飞书文档', '生成飞书文档', or requests to produce structured or complete documents within Feishu. This applies to scenarios requiring fully formatted documents, including but not limited to: technical documentation, PRDs, project plans, reports, notes, articles, or novels. Use this skill whenever content needs to be compiled, structured, and delivered as a Feishu document."
---

# 通用飞书文档创建技能

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The Chinese manifest text says the skill 'must' be used whenever users request document creation in Chinese-language scenarios, but it does not define locale or language-scoping constraints. This can create forced routing behavior for Chinese-language requests without ensuring the user actually wants Feishu, increasing the chance of mis-triggering and unintended handling of user content.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.