Back to skill

Security audit

Math Proof

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent math-proof helper, but it can copy arbitrary user-selected local files or folders into repeated subagent prompts without clear limits or privacy safeguards.

Review before installing. Use this skill only with narrow, non-sensitive reference files, not broad directories, credentials, private notes, or project folders with secrets. Expect extra latency or cost from the A/B retry loop, and explicitly state output language and retry expectations when using 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
SKILL.md:39
Finding

Unrestricted Local Reference Ingestion and Unsafe Prompt Composition

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 39–85
Vulnerability Type: Unrestricted local file ingestion and prompt injection
Risk Level: Medium

Vulnerable Code Snippet

markdown
### 2. Reference Materials (optional)

Ask: *"Do you want A and B to reference any local files or folders? (e.g., textbook chapters, lecture notes, theorem references)"*

If yes, the user specifies a path (file or folder). Its contents will be included in every spawn prompt sent to both A and B as context/reference material.

## Constraints & Rules

### User-Supplied Constraints

The user may supply constraints that must be passed to **both** A and B:

- Proof method restrictions: "纯几何" / "综合法" / "不能用向量" / "不能用塞瓦定理" / "解析几何" / "代数法" / "数学归纳法"等
- Tool restrictions: "不能用坐标" / "不能用微积分" / "初等方法"等
- Format requirements: "用 LaTeX" / "用中文" / "step by step"等

These constraints must be included verbatim in every spawn prompt sent to both A and B.

### Spawn A (first attempt)

{
  "mode": "run",
  "task": "请严格证明以下定理:\n\n[定理陈述]\n\n[参考材料(如有)]\n\n要求:\n[用户约束,逐条列出]\n\n用 LaTeX 格式输出完整证明。"
}

### Spawn B (review)

{
  "mode": "run",
  "task": "请严格审查以下证明。\n\n[证明全文]\n\n[参考材料(如有)]\n\n请逐行检查:\n1. 每一步的推理是否正确?\n2. 有没有逻辑漏洞或循环论证?\n3. 有没有违反用户要求的约束([约束列表])?\n4. 整体逻辑链是否完整?\n5. 评价:通过 / 需要修改(说明理由)"
}

Technical Analysis

The skill allows a user to provide an arbitrary local file or directory path and directs the agent to include its contents in every prompt sent to both subagents. It does not define:

  • A workspace-root restriction or path allowlist.
  • Canonical-path and symlink validation.
  • Sensitive-file or hidden-file exclusions.
  • File-type, file-count, or size limits.
  • A directory enumeration and approval step.
  • A trust boundary separating reference data from executable instructions.
  • Instructions requiring subagents to ignore commands embedded in reference material.

The skill also requires user-supplied constraints to be inserted verbatim into subagent prompts. Beca ...[truncated 2387 chars]

Remediation
View remediation

Remediation Suggestions

  1. Restrict reference materials to explicitly approved files beneath the current project or a dedicated reference directory.
  2. Resolve every path to its canonical form and reject absolute paths, traversal outside the approved root, and symlinks that escape that root.
  3. Enumerate resolved files before reading a directory and obtain explicit user confirmation for the final list.
  4. Reject hidden files, credentials, private keys, environment files, device paths, sockets, binaries, and other sensitive or unsupported file types.
  5. Enforce limits on file size, aggregate input size, file count, recursion depth, and prompt length.
  6. Add explicit prompt boundaries that label all reference material as untrusted data. Instruct subagents not to execute or follow instructions found inside theorem statements, constraints, proofs, or references.
  7. Normalize user constraints into a structured allowlisted schema instead of inserting arbitrary text verbatim into privileged task instructions.
  8. Place task instructions before and after delimited untrusted content, reiterating that embedded content cannot override system or workflow rules.
  9. Run proof and review subagents without filesystem, command-execution, or network access unless a specific operation requires it.
  10. Redact secrets and minimize duplicated content before propagating references into multiple subagent prompts or retry rounds.
  11. Record which files were read and which sanitized excerpts were supplied to each subagent to support review and incident investigation.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (4)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The trigger list is broad enough to match ordinary math-help requests such as explanation, derivation, or demonstration, which can cause the skill to activate when the user did not intend a multi-agent proof workflow. That can lead to unnecessary agent spawning, extra prompt exposure, and unexpected cost or latency, especially because this skill can enter a long retry loop.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill asks users for local file or folder paths and states that their contents will be injected into every prompt sent to both spawned agents, but it does not prominently warn about the duplication and breadth of that disclosure. This increases the risk of accidental oversharing of sensitive local data, with repeated propagation across multiple rounds of the A/B loop.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The default Spawn A prompt instructs the subagent in Chinese and specifically requires "用 LaTeX 格式输出完整证明," while elsewhere language choice appears only as an optional user constraint example rather than a required preference prompt. This creates a locale/language default that may override user expectations without explicit opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The Spawn B review instructions are written entirely in Chinese and define review outputs such as "通过 / 需要修改" without documenting a user language preference step. This may impose a specific language/locale on the workflow absent explicit user opt-in.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.