Back to skill

Security audit

Markdown to Feishu Post

Security checks for vulnerabilities and agentic risk

Overview

This is a local Markdown-to-Feishu JSON converter with no hidden network, credential, or persistence behavior, though malformed mention text can make it hang.

Safe to install for local Markdown-to-Feishu conversion, but avoid exposing it directly to untrusted message input until the malformed at-mention parsing loop is fixed or wrapped with timeouts and input limits.

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/markdown_to_feishu_post.py:33
Finding

Malformed Mention Syntax Causes an Infinite Parsing Loop

Content
View full analysis
name at_match = re.match(r'([^<]*)', text[pos:]) if at_match: elem = {"tag": "at", "user_id": at_match.group(1)} if inherited_styles: elem["style"] = list(set(inherited_styles)) elements.append(elem) pos += at_match.end() continue ``` ```python # Plain text - collect until next special character plain_text = "" while pos < length: char = text[pos] if char in '*~`[([^<]*) ``` However, the plain-text scanner stops on the substantially broader prefix: ```regex ` therefore fails the complete mention parser but s ...[truncated 2025 chars]
Remediation
View remediation
([^<]*)' ) ``` 3. Add a defensive progress guard around the outer loop: ```python while pos < length: iteration_start = pos # Existing parsing logic... if pos == iteration_start: elements.append({ "tag": "text", "text": text[pos], **({"style": list(set(inherited_styles))} if inherited_styles else {}) }) pos += 1 ``` 4. Treat malformed markup as ordinary text or return a controlled validation error. Do not allow partially recognized syntax to halt consumption. 5. Add regression tests covering at least: ```text name name ``` Each test should verify that parsing terminates within a bounded time and that malformed input is either preserved as text or rejected with a defined error. 6. If this converter is exposed through a service, additionally apply request-size limits, execution timeouts, worker isolation, and rate limiting as defense-in-depth measures. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • 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 (6)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documented output structure fixes the top-level locale to "zh_cn", and the notes state that default output is zh_cn. This imposes a specific language/locale by default without indicating user choice or opt-in, which can violate language or locale policy expectations.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest says the skill converts standard Markdown to Feishu post JSON and supports multi-level headings. In code, the first # heading is treated specially as the post title and is not emitted as a heading element in content, which changes the document semantics rather than simply converting it.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The generated Feishu post structure is always wrapped under the zh_cn locale key, which forces a specific language/locale in the output. The file does not offer any user opt-in, alternative locale selection, or documentation justifying this restriction as region-specific.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The description says the skill should be used whenever a user needs to send Feishu rich-text messages, convert Markdown to Feishu format, or build Feishu bot message content. These are broad natural-language conditions rather than specific trigger phrases or constrained contexts, which can cause unintended invocation overlap with general messaging or formatting requests.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

The docstring states support for images as part of standard Markdown conversion, suggesting broad Markdown image handling. The implementation only maps images to Feishu img elements using the parenthesized value as image_key, ignores alt text, and separately special-cases full-line images, which does not fully match the plain-language claim of standard image support.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.