Back to skill

Security audit

数学复习资料生成器

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its math-review purpose, but it can trigger broadly and requires hidden workspace activity logging, so users should review it before installing.

Install only if you are comfortable with automatic HTML file creation in the working directory and persistent task logs under .workbuddy/memory. Consider removing or making the memory-writing stage opt-in, and narrow activation so ordinary math Q&A does not create files unexpectedly.

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

other

Note
Location
SKILL.md:202
Finding

Undisclosed Persistent Workspace Activity Logging

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 202-208
Vulnerability Type: Persistent workspace activity logging
Risk Level: Low

Relevant instruction, translated into English from the source:

text
After completing each generation task, append a daily record to working memory:
- File path and content summary
- Problems discovered and corrected, if any
- Counts of questions and diagrams

Memory file path: {workspace}/.workbuddy/memory/YYYY-MM-DD.md

Technical Analysis

The Skill requires every completed generation task to append metadata to a hidden, persistent file under the user's workspace. The recorded information includes the generated file path, a content summary, correction history, and document statistics.

This write is not necessary to generate, validate, preview, or deliver the requested mathematics document. It is also not disclosed in README.md, meaning a user may reasonably invoke the Skill without expecting persistent activity records to be created.

The behavior is not classified as T02: Agent Memory Poisoning because the identified instructions do not write attacker-controlled behavioral rules intended to influence future agent sessions. It is instead classified as an unlisted privacy and workspace-modification issue.

Attack Path

  1. A user invokes the Skill to generate mathematics review material.
  2. The Skill creates and validates the requested HTML document.
  3. Stage 6 instructs the agent to append task metadata to .workbuddy/memory/YYYY-MM-DD.md.
  4. The persistent record may contain user topic information, generated filenames, workspace paths, and correction history.
  5. A later agent session or another process with workspace read access can inspect this retained activity history without requiring the original conversation.

No external exfiltration, privilege escalation, or executable persistence was identified.

Impact Assessment

The behavio ...[truncated 675 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove the mandatory Stage 6 memory-write requirement unless persistent recording is essential to the Skill's documented purpose.
  2. Make activity logging explicitly opt-in and request user consent before creating or updating a memory file.
  3. Disclose the exact destination, retained fields, purpose, and retention period in both README.md and SKILL.md.
  4. Record only minimal, non-sensitive metadata; avoid content summaries, absolute paths, user-provided text, and correction details.
  5. Use a user-approved storage location rather than a hidden workspace directory.
  6. Provide a mechanism to inspect, disable, and delete retained records.
  7. Prevent generated or user-controlled content from being stored as future behavioral instructions.
  8. If logging remains enabled, apply restrictive file permissions appropriate to the host environment.
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

声明的核心用途是“生成”初中数学复习资料 HTML,而代码的核心行为是“验证/审查”一个已存在的 HTML 文件中的题目与答案是否合理。虽然两者都与数学题目和 HTML 有关,但主功能明显不同:一个是内容生成,一个是离线校验。代码没有生成知识点、SVG 图形、练习题或详解的逻辑,也没有对话式触发处理;相反,它依赖特定 HTML 结构(如 q-card、answer-box)来解析并检查题目。因此这是实质性描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

声明描述的核心能力是“生成数学复习资料 HTML 文档”,属于内容生产型 Skill;而给出的代码核心行为是“校验 HTML 中 SVG 数学图形是否正确”,属于质量检测/静态验证工具。两者主目的明显不同。虽然二者都与数学 HTML/SVG 有关,但该代码既不生成知识点、题目、详解,也不实现对话触发下的复习资料产出,仅对输入文件做解析和检查,因此属于实质性描述—行为不匹配。

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The activation phrases are extremely broad, including generic requests like '数学辅导' and '生成数学学习文档', and the skill claims it may be called in any conversation. Overbroad routing increases the chance of unintended invocation, which in this skill matters because it can read files, write output HTML, and persist memory records without a narrowly scoped user intent.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The invocation phrases are broad enough to match ordinary tutoring or study-help requests in arbitrary conversations, which can cause the skill to trigger without clear user intent to create files or run its workflow. In this skill’s context, that increases the chance of unexpected capability activation and unintended document generation, even though the domain is educational rather than inherently dangerous.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README states that the skill automatically generates an HTML file but does not warn users that file creation will occur or describe where the file will be written. Unexpected file creation is risky because users may invoke what sounds like normal study assistance and unintentionally trigger persistent output or downstream processing.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
83% confidence
Finding

The skill instructs reading local files such as references/template_guide.md and validator scripts, but it declares no explicit tool or permission scope. That creates a capability/consent gap: an agent may access workspace files without clear user visibility or sandbox restrictions, which can expand unexpectedly if the skill is invoked in unrelated contexts.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill directs writing an HTML file to the current working directory and later writing memory records, but the description does not prominently warn users that persistent files will be created. Hidden or under-disclosed side effects undermine informed consent and can lead to clutter, overwrite risk, or unintended retention of user-derived content.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill requires writing persistent 'work memory' records containing file paths, content summaries, and issue logs to {workspace}/.workbuddy/memory/YYYY-MM-DD.md, even though that persistence is not necessary to satisfy the user's request. This creates a privacy and data-minimization risk because user content and workflow details may be retained across sessions without explicit consent.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The example triggers include ambiguous requests such as asking for theorem explanations or a study plan, without boundaries distinguishing when the skill should not run. This can cause accidental activation and unexpected file generation or validation steps in situations where the user only wanted a simple conversational answer.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The file title and content are entirely in Chinese, and the embedded HTML explicitly sets lang="zh-CN". This imposes a specific language/locale on generated output without any stated user opt-in or explanation that the skill is intentionally limited to a China-specific use case.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

The entire skill description is written only in Chinese and frames the skill for Chinese-language use without indicating that users may choose another language or that the locale restriction is intentional. Under the policy, forcing a specific language without opt-in 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
95% confidence
Finding

This code file contains natural-language documentation exclusively in Chinese, including the module docstring and usage guidance. Under the policy, forcing a specific language without user opt-in is a locale/language policy concern unless the constraint is explicitly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

This code file contains user-facing natural-language text exclusively in Chinese in the module docstring and usage instructions. Under the policy, forcing a specific language without user opt-in can be a locale-policy violation, and no alternative language option or justification is provided here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The argparse description and help strings shown to users are hardcoded in Chinese. Because the file does not offer a language choice or document a justified region-specific constraint, this appears to violate the language/locale policy criteria.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.