Back to skill

Security audit

飞书文档文件夹摘要生成器

Security checks for vulnerabilities and agentic risk

Overview

The skill does what it says, but it can recursively read and summarize many Feishu documents without an explicit scope confirmation or privacy warning.

Review before installing if your Feishu workspace contains confidential or regulated material. Use it only on folders you intend to summarize in full, and ask the agent to confirm the exact folder, expected document count, recursion depth, and output destination before it reads documents. Treat generated Markdown as untrusted if other users can edit the source document titles or content.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/summary_generator.py:16
Finding
Unsanitized Feishu Content Injection into Generated Markdown Reports## Vulnerability Details **File Location**: `scripts/summary_generator.py:16-20`, `scripts/summary_generator.py:30-34`, and `scripts/summary_generator.py:49-65` **Vulnerability Type**: Markdown content injection caused by missing output encoding **Risk Level**: Medium ### Vulnerable Code ```python return f"""# {folder_name} Document Summary Report **Source:** {url} **Generated:** {timestamp} **Total Documents:** {total_docs} ``` ```python def add_node(node: Dict, prefix: str = "", is_last: bool = True): connector = "└── " if is_last else "├── " tree_line = f"{prefix}{connector}{node['title']}\n" nonlocal tree tree += tree_line ``` ```python def generate_document_summary(doc: Dict, index: str) -> str: """Generate summary for a single document.""" title = doc.get('title', 'Untitled') doc_type = doc.get('type', 'unknown') status = doc.get('status', 'unknown') summary = doc.get('summary', 'No summary available') status_emoji = { 'complete': '✅', 'in_progress': '🚧', 'empty': '⚠️', 'unknown': '❓' }.get(status, '❓') return f"""### {index} {title} - **Type:** {doc_type} - **Status:** {status_emoji} {status.replace('_', ' ').title()} - **Summary:** {summary} ``` ### Technical Analysis The report generator directly interpolates the source URL, folder name, document titles, document types, and generated summaries into Markdown without contextual escaping or validation. In particular, document titles are also inserted inside a fenced code block used for the directory tree. A title containing newline characters and a closing triple-backtick sequence can terminate that block and inject arbitrary Markdown into the remainder of the report. Titles and summaries inserted outside the code block can directly introduce headings, links, images, HTML supported by the renderer, or other deceptive formattin ...[truncated 2195 chars]
Remediation
## Remediation Suggestions 1. Introduce context-specific Markdown escaping for all untrusted values, including `folder_name`, `url`, `node['title']`, `title`, `doc_type`, and `summary`. 2. For directory-tree entries, normalize carriage returns and newline characters and neutralize all backtick sequences before placing values inside the fenced code block. Alternatively, generate the tree as escaped list items rather than as a code fence. 3. Prevent summaries and titles from introducing raw HTML, links, images, headings, or block-level Markdown unless those features are explicitly required. 4. Validate source URLs with a URL parser. Require HTTPS and an expected Feishu hostname rather than relying on string-pattern matching. 5. If links are required, construct them from validated components and apply URL encoding rather than inserting an arbitrary supplied URL. 6. Configure the final Markdown renderer to disable raw HTML and automatic remote resource loading where possible. 7. Add tests using hostile inputs, including embedded newlines, triple backticks, image syntax, HTML tags, deceptive links, and bidirectional control characters. 8. Treat all fetched Feishu content as untrusted data. The skill instructions should explicitly state that instructions embedded in documents must be summarized as content and must never be followed as agent directives.
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (2)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The declared description promises an end-to-end Feishu folder summarization capability: recursively scan a Feishu wiki/drive location, read all contained documents, and produce a comprehensive Markdown report. The actual code chunk contains only helper functions to generate Markdown sections, build a directory tree string from an already-supplied structure, classify content status, and extract simple summary points from text already in memory. There is no network access, no Feishu authentication or API usage, no URL parsing, no recursion over remote resources beyond formatting a provided tree object, and no orchestration logic to fetch documents from a Feishu folder. While the code aligns loosely with the reporting part of the description, it lacks the core advertised capabilities, so the description materially overstates what this code actually does.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The skill is explicitly designed to recursively read and summarize all documents in a Feishu folder, which can include large amounts of sensitive internal content. Without a clear warning or confirmation step, users may trigger bulk access and summarization of confidential data without understanding the privacy implications or scope of collection.

Static analysis

No suspicious patterns detected.