Back to skill

Security audit

詹明明·做成一个技能

Security checks for vulnerabilities and agentic risk

Overview

The skill is not malicious, but it needs review because broad local memory and mutable vault rules can influence generated skills.

Install only if you are comfortable with this skill reading shared agent memory and letting local vault rule files guide new skill creation. Keep vault and memory directories trusted, review any generated skill before use, and avoid storing secrets or unrelated private content in the shared memory area.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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 (2)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:19
Finding
Broad Access to Shared Agent Memory## Vulnerability Details **File Location**: `SKILL.md`, line 19 **Vulnerability Type**: Excessive access to shared persistent memory **Risk Level**: Medium **Complete Code Snippet**: ```markdown 先读 `config.yaml`(读不到 → 明说配置缺失并停下,不用示例值假装是用户的设定),再读 `zmm/references/交互规范.md`(🔴 **不是读一遍就算**:收尾按 §四 三件套 —— Recap · Before/After · **下一步给编号选项**;缺信息按 §四 用**选择题**问,**一次只问一个**;不适用的情况见 §五),再读 `zmm/references/家族公约.md`,再读记忆 `{config.paths.memory}/zmm-skillify/` + `_通用/`。 ``` ### Technical Analysis The Skill instructs the agent to read both its dedicated memory directory and the shared `_通用/` memory directory. Access to a broad shared-memory location is not constrained by a file allowlist, relevance check, data classification, or user-consent gate. The Skill's legitimate task is to extract a reusable workflow from the current completed session. Reading unrelated shared memory exceeds the minimum access required for that task. Shared memory may contain private historical context or untrusted text written by other workflows. Loading such content into the active model context may disclose unrelated information or allow stored instructions to influence the generated Skill. ### Attack Path 1. An attacker, compromised Skill, or unrelated workflow writes crafted content into the shared `_通用/` memory directory. 2. A user invokes this Skill to preserve a completed workflow. 3. Following line 19, the agent reads the entire relevant shared-memory location without an allowlist or trust boundary. 4. The crafted content enters the active context and may be treated as guidance. 5. The content influences the generated Skill files or causes unrelated private memory to be reflected in outputs. ### Impact Assessment Successful exploitation may expose unrelated persistent-memory content to the current session and influence generated artifacts. The accessible scope is limited by the agent's existing filesystem permissions and the configured memory path; the ...[truncated 185 chars]
Remediation
## Remediation Suggestions - Read only `{config.paths.memory}/zmm-skillify/` by default. - Require explicit user approval before accessing shared memory. - Use a narrow file allowlist rather than reading an entire shared directory. - Select only records demonstrably relevant to the current workflow. - Treat all loaded memory as untrusted reference data, never as executable instructions. - Prevent memory content from overriding system, safety, package, or user instructions. - Redact secrets and unrelated personal data before placing memory content into model context or generated files. - Record which memory files were consulted so access can be reviewed.

T01 · Skill Instruction Hijacking

Warning
Location
SKILL.md:21
Finding
Untrusted External Vault Rules Override Packaged Instructions## Vulnerability Details **File Location**: `SKILL.md`, line 21; corroborated by `references/规则卡.md`, line 4 **Vulnerability Type**: External instruction precedence and indirect prompt injection **Risk Level**: Medium **Complete Code Snippets**: ```markdown 本技能内置判据在 `references/规则卡.md`(判据 / 为什么 / 怎么查 / 强度),开工前读一遍;`{vault}` 里有对应的规则文件时以 vault 为准、规则卡为底。 ``` ```markdown > 作者环境里 `{vault}` 有对应的规则文件时,**以 vault 为准,本文件为底**;两处不一致先按 vault 做,再回来修这里。 ``` ### Technical Analysis The Skill explicitly gives externally stored vault files precedence over the packaged rule card. Vault content is outside the audited artifact and can change after package review. Consequently, the effective instructions executed by the agent are not fully represented by the reviewed package. This creates an indirect instruction-injection boundary: anyone able to modify a corresponding vault rule can replace or weaken packaged behavior. The files provide no schema validation, integrity verification, provenance check, conflict review, or restriction preventing vault text from altering safety-relevant behavior. The second occurrence in `references/规则卡.md` confirms the same policy and directs the agent to follow the vault first whenever the two sources conflict. ### Attack Path 1. An attacker or compromised local process obtains write access to a corresponding rule file under `{vault}`. 2. The attacker inserts instructions that conflict with the packaged criteria or request additional actions and access. 3. A user invokes the Skill. 4. The agent loads the vault file and, under the explicit precedence rule, follows it instead of the audited packaged rule card. 5. The modified rules influence workflow extraction, generated Skill content, local file operations, or final responses within the permissions already available to the agent. ### Impact Assessment Exploitation can alter the Skill's effective behavior after review and can compromise the integrity o ...[truncated 408 chars]
Remediation
## Remediation Suggestions - Do not allow vault content to override packaged instructions automatically. - Treat vault files as untrusted reference data with lower precedence than system, safety, user, and packaged Skill instructions. - When a conflict occurs, display a concise diff and require explicit user approval before applying the external rule. - Restrict accepted vault files to an allowlisted directory and expected filenames. - Parse vault rules through a strict schema instead of treating arbitrary prose as instructions. - Validate file ownership, permissions, provenance, and cryptographic hashes where practical. - Reject rules that request expanded permissions, execution, publication, credential access, or unrelated file access. - Log the exact vault paths, versions, and hashes used for each run. - Apply the same hardened precedence policy to both `SKILL.md` and `references/规则卡.md`.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (1)

Ssd 3

Medium
Confidence
88% confidence
Finding
The rule explicitly requires logging each loop's inputs, outputs, and decisions, which can capture prompts, user content, model responses, and possibly sensitive operational data in natural-language form. In a skill that extracts and operationalizes prior session workflows, this context increases risk because the logged material may include private conversation details or proprietary process data that persist beyond the original interaction.

Static analysis

No suspicious patterns detected.