Back to skill

Security audit

Handover Memory Pack

Security checks for vulnerabilities and agentic risk

Overview

This skill is a local handover-note formatter with disclosed file input/output behavior and no evidence of hidden execution, exfiltration, or persistence.

Install only if you want a Chinese-language local handover draft generator. Feed it intended handover notes, avoid plaintext secrets or unnecessary personal data, and treat generated Markdown from untrusted input as untrusted content when opening or sharing it.

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/run.py:47
Finding

Unescaped Markdown and HTML Injection in Generated Reports

Content
View full analysis

Vulnerability Details

File Location: scripts/run.py, lines 47–55
Vulnerability Type: Untrusted content injection into Markdown output
Risk Level: Medium

Vulnerable Code

python
bullets = [line.strip("- ").strip() for line in input_text.splitlines() if line.strip()]
bullets = bullets[:18]
out = [f"# {title} 结果", "", f"> 模式:{spec['mode']}", f"> 摘要:{summary}", ""]
for idx, section in enumerate(sections):
    out.append(f"## {section}")
    if bullets:
        selected = bullets[idx::max(1, len(sections))][:3]
        for item in selected:
            out.append(f"- {item}")

Technical Analysis

The report generator treats each non-empty input line as a bullet and inserts it directly into Markdown output without escaping Markdown metacharacters or removing raw HTML.

An attacker able to influence a handover input document can supply active Markdown or HTML, for example:

markdown
<img src="https://attacker.example/track">

or:

markdown
![document](https://attacker.example/track)

These payloads remain active in the generated report. If the report is opened in a Markdown renderer that permits raw HTML or automatically retrieves remote images, the renderer may contact an attacker-controlled server.

The function also does not distinguish ordinary handover information from structural Markdown. Consequently, crafted headings, links, images, and HTML can alter the generated report's presentation or introduce deceptive content. Exploitability and final behavior depend on the Markdown viewer's security policy.

Attack Path

  1. An attacker prepares or modifies a handover input file.
  2. The attacker places crafted Markdown or HTML in one of its non-empty lines.
  3. A user processes the file with scripts/run.py.
  4. make_structured_report() copies the crafted line directly into the generated report.
  5. The user or another recipient opens the report in an active Markdown or HTML renderer.
  6. The injected content changes th ...[truncated 686 chars]
Remediation
View remediation

Remediation Suggestions

  1. Escape Markdown control characters in all untrusted input before interpolation, including backslashes, backticks, asterisks, underscores, braces, brackets, parentheses, angle brackets, hash signs, plus signs, hyphens, exclamation marks, and pipe characters.
  2. Strip or encode raw HTML tags rather than passing them through to the report.
  3. Consider treating input as plain text and emitting it inside fenced code blocks or another inert representation where appropriate.
  4. If links are required, parse and validate them explicitly. Permit only approved schemes and consider blocking remote images by default.
  5. Add output-sanitization tests covering:
    • Raw HTML tags.
    • Markdown images and links.
    • Injected headings and block quotes.
    • Nested or malformed Markdown.
    • javascript:, data:, and remote-resource URLs.
  6. Document that generated reports should be opened with remote-content loading disabled unless the output has been sanitized.
  7. Apply equivalent sanitization to every report-building function that may later interpolate untrusted file contents.
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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 (14)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

声明描述的是一个面向交接/知识传承工作流的内容整理工具;而实际代码并未实现专门的知识交接、记忆提炼、显性/隐性知识归纳逻辑。相反,它通过 spec['mode'] 驱动,主要提供若干通用审计与扫描能力:目录概览、CSV字段分析、风险模式匹配、Skill 文件完整性与 frontmatter 检查。虽然 structured_brief 模式会把输入文本按章节重组,表面上可用于总结材料,但这只是众多模式之一,且整体主功能更像“本地审计/报告生成器”。此外,代码还会扫描并部分展示疑似 secret/token/password 片段,这与声明中“不要泄露不该交接的密钥”的安全边界并不一致(尽管它对部分匹配做了掩码)。因此,代码行为与声明用途存在明显的主用途和能力范围不匹配。

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The trigger phrases are short and generic enough that ordinary user requests about organizing handover notes could unintentionally invoke this skill. In a handover context, accidental activation matters because the skill is designed to process operational knowledge and may encourage consolidation of sensitive internal information into a single artifact.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The natural-language content in this skill file forces a specific language/locale presentation without documenting user choice or opt-in. Under the policy, language constraints should either be optional for the user or clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill advertises shell-capable behavior via python3 .../scripts/run.py and references local files for input/output, but it does not declare any explicit tool scope such as allowed tools or permissions. This creates an authorization and review gap: a caller or host may not have a clear policy boundary for file access and command execution, increasing the chance of unintended filesystem reads/writes or script execution in a handover workflow.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The description and routing examples are primarily in Chinese, with additional English phrases embedded, but the skill never states that it is Chinese-only or asks the user for a preferred language. This can violate language/locale policy because it implicitly forces or assumes a language without explicit opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The entire example output is written in Chinese and presents a fixed-output template with no indication that users can choose another language or that the skill is limited to a Chinese-language context. This can violate language/locale policy when a skill implicitly forces a specific language without explicit opt-in or justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The title, summary, input hint, section names, examples, and risk text are all written in Chinese, with no indication that the skill is region-specific or that users may choose another language. This can violate language/locale policy when a skill implicitly requires a specific language without opt-in or documented justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The generated report strings are hard-coded in Chinese, including headings, summaries, and next-step guidance. This imposes a specific language on all users without offering a locale selection or explaining that the skill is region-specific, which matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The built-in pattern scanning searches for secrets, internal URLs, and dangerous shell constructs across arbitrary files, which is not clearly justified by the declared handover-memory use case. In a handover context this is especially risky because the tool may surface sensitive snippets from local repositories or operational documents and include them in generated reports, creating a new disclosure channel.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script supports multiple generic audit modes such as directory, CSV, pattern, and skill-audit that go beyond the stated handover/knowledge-transfer purpose. This capability expansion increases the chance the skill will be used to inspect unrelated local content and produce summaries of files or project structure, which broadens data exposure and violates least-privilege expectations for the skill.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The entire smoke-test document is written in Chinese and does not provide any indication that language selection is optional or that the skill is intentionally limited to a Chinese-speaking context. Under the policy, forcing a specific language without user opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

The README is entirely in Chinese and does not indicate whether the skill supports other languages or requires Chinese by design. Under the language/locale policy, forcing a specific language without user opt-in or documented justification can be a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

This markdown file is entirely presented in Chinese, and there is no natural-language indication that the user can choose another language or that the skill is intentionally limited to a Chinese-speaking context. Under the policy rule for language or locale constraints, forcing a specific language without user opt-in can be a policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The entire template, including the title and section instructions, is written only in Chinese and presents the output format as fixed. This can violate a language/locale policy when users are not offered a choice of language or informed that the skill is region- or language-specific.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.