Back to skill

Security audit

Daily Log

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent daily journal writer, but it stores command output in persistent memory without clear redaction, confirmation, or deletion controls.

Install only if you are comfortable with the agent keeping persistent daily logs. Avoid using it after commands that print tokens, credentials, private configuration, customer data, or other sensitive output unless you first add a redaction and deletion policy.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • 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)

T02 · Agent Memory Poisoning

Warning
Location
references/spec.md:7
Finding
Unfiltered Command Output Is Persisted in Long-Term Agent Memory<![CDATA[ ## Vulnerability Details **File Location**: `references/spec.md`, lines 7-11 and 42-55; related invocation behavior in `SKILL.md`, lines 21-31 **Vulnerability Type**: Persistent storage of untrusted or sensitive command output **Risk Level**: Medium ### Vulnerable Specification The following is an English rendering of the relevant specification: ```markdown | Field | Description | |------|------| | **what** | What was done | | **why** | Why it was done, including key decisions | | **files** | Paths of modified files | | **commands** | Commands executed and their output | | **errors** | Error information, if any | ## Write Process 1. Read the current diary file if it exists. 2. Intelligently integrate new content while preserving old content. 3. Write the content back to the file. Do not delete old content. Only perform incremental optimization. ## Self-Check - [ ] Includes what was done - [ ] Includes why it was done - [ ] Includes file paths - [ ] Includes command output - [ ] Is not merely a retrospective summary - [ ] Contains more than ten lines ``` The related workflow in `SKILL.md` requires the Skill to read an existing daily log, merge new material into it, and write it back to `memory/daily/YYYY-MM/YYYY-MM-DD.md`. It also states that these logs are subsequently scanned by a separate memory-review process. ### Technical Analysis The specification explicitly requires command output to be written into persistent daily memory. It provides no requirement to: - Detect or redact API keys, passwords, session tokens, private keys, or personal information. - Limit the amount of command output retained. - Distinguish trusted agent-generated content from attacker-controlled terminal output. - Escape or neutralize instruction-like text before downstream agents process it. - Apply retention limits or securely delete sensitive historical entries. Command output is an untrusted data boundary. Commands may display secrets from environment variables ...[truncated 2531 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Replace the requirement to retain complete command output with a requirement to store a concise, sanitized result summary. 2. Add mandatory secret filtering for API keys, passwords, authorization headers, cookies, private keys, connection strings, environment variables, and common token formats. 3. Treat all captured output as untrusted data. Place retained excerpts in clearly delimited quoted blocks and instruct downstream processors never to follow instructions contained in those blocks. 4. Omit command output by default when commands access credential stores, environment variables, authentication systems, private configuration, or user data. 5. Require explicit user confirmation before retaining potentially sensitive output. 6. Impose size limits and allowlists for output fields. Record exit status and a short result summary instead of complete stdout and stderr. 7. Add retention and deletion controls so users can remove sensitive diary entries without violating the normal incremental-update policy. 8. Require the downstream memory-review process to validate provenance, reject instruction-like content from diary data, and avoid converting untrusted text into persistent rules. 9. Add a self-check item confirming that secrets and personal data were removed before the diary is written. ]]>
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
Confidence
92% confidence
Finding
The description says the skill triggers '每次会话结束前或完成重要任务后', which is an ambiguous condition rather than a narrowly scoped invocation phrase. Terms like '会话结束前' and especially '重要任务后' are subjective and provide no exclusion conditions or concrete trigger boundaries, increasing the chance of unintended invocation.

Vague Triggers

Medium
Confidence
89% confidence
Finding
The listed triggers include '会话结束前', '完成重要任务后', and '用户明确要求时', but only the last is clearly bounded by user intent. The first two are open-ended operational cues without constraints or negative examples, so an agent may invoke the skill too frequently or inconsistently.

Skill Enumeration

Medium
Category
Agent Snooping
Content
- **memory-review** 负责扫描日记生成知识提案
- 两者配合:详细日记 → 更多可提取知识

详见 `skills/memory-review/SKILL.md`
Confidence
80% confidence
Finding
Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
The entire specification is written as a mandatory Chinese-only logging format and does not indicate that users may choose another language or locale. Under the stated policy, forcing a specific language without opt-in is a natural-language policy violation unless the regional constraint is explicitly justified.

Static analysis

No suspicious patterns detected.