Back to skill

Security audit

Memory Harness

Security checks for vulnerabilities and agentic risk

Overview

This memory-harness skill has purpose-aligned goals, but it overstates automatic safety controls and under-discloses broad memory recall, writeback, and raw prompt logging behavior.

Review this skill before installing. It is not clearly malicious, but it should not be treated as an enforceable safety or memory-control layer as written. Install only if you are comfortable with broad recall triggers, possible persistence of selected conversation details, and raw user messages appearing in logs, or after the publisher narrows triggers, documents retention and consent, removes raw prompt logging, and makes the pre-execution gate actually block or fail closed.

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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/pre-execution-gate.js:15
Finding
Pre-execution safety gate always fails open<![CDATA[ ## Vulnerability Details **File Location**: `scripts/pre-execution-gate.js:15-34` **Vulnerability Type**: Fail-open security control **Risk Level**: High ### Vulnerable Code ```js function preExecutionGate(plan, constraints = []) { const result = { proceed: true, warnings: [], constraints: [], conflicts: [], }; // Check for safety issues const safetyCheck = checkSafetyConstraints(plan); if (safetyCheck.hasIssues) { result.warnings.push(...safetyCheck.warnings); } // Check for conflicts const conflictCheck = checkConflicts(plan, constraints); if (conflictCheck.hasConflicts) { result.conflicts.push(...conflictCheck.conflicts); result.warnings.push(...conflictCheck.conflicts); } // Add relevant constraints result.constraints = constraints.filter(c => isRelevantToPlan(c, plan)); return result; } ``` ### Technical Analysis The gate initializes `proceed` to `true` and never changes it. Detected safety issues and conflicts are only copied into warning arrays. Consequently, plans containing patterns such as `rm -rf`, `DROP TABLE`, `DELETE FROM`, `eval`, `exec`, or `child_process` still receive an affirmative execution decision. This is a fail-open implementation of a security boundary. A caller that uses `proceed` as the authoritative go/no-go result will approve operations that the gate itself has identified as dangerous. The issue does not directly execute commands, but it defeats the intended protection around a downstream execution mechanism. ### Attack Path 1. An attacker or untrusted user submits a plan containing a dangerous operation. 2. `checkSafetyConstraints` or `checkConflicts` identifies the operation and returns warnings. 3. `preExecutionGate` records those warnings but leaves `result.proceed` equal to `true`. 4. A downstream caller checks only `proceed`. 5. The dangerous operation is treated as approved and may be executed by the caller. ### Impact Assessment The impact ...[truncated 478 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Default the gate to deny when the plan cannot be validated. - Set `result.proceed = false` whenever a blocking safety issue or constraint conflict is detected. - Distinguish informational warnings from blocking findings using explicit severity and policy fields. - Validate the shape and type of `plan.description`, `plan.scope`, and all constraint properties before processing. - Require explicit authorization for destructive or system-scoped operations. - Ensure downstream callers enforce the returned decision rather than merely displaying warnings. - Add automated tests proving that each dangerous pattern and each confirmed constraint conflict produces `proceed: false`. A minimal correction would include logic equivalent to: ```js if (safetyCheck.hasIssues) { result.proceed = false; result.warnings.push(...safetyCheck.warnings); } if (conflictCheck.hasConflicts) { result.proceed = false; result.conflicts.push(...conflictCheck.conflicts); result.warnings.push(...conflictCheck.conflicts); } ``` ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scripts/harness.js:27
Finding
Mandatory pre-execution gate is not invoked and can be falsely reported as active<![CDATA[ ## Vulnerability Details **File Location**: `scripts/harness.js:27-59` **Vulnerability Type**: Missing security-control enforcement and spoofable audit state **Risk Level**: High ### Vulnerable Code ```js const preExecution = !!parsed.pre_execution; const recallDecision = run("should-recall.js", { text, intent, entities }); let recallResult = { status: "not_needed", mode: null, items: [] }; let compressed = { totalCount: 0, compressedCount: 0, items: [] }; if (recallDecision.needed) { recallResult = run("targeted-recall.js", { mode: recallDecision.mode, text, entities }); compressed = run("memory-compress.js", { items: recallResult.items || [] }); } const logLine = execFileSync( "node", [ path.join(DIR, "structured-log.js"), JSON.stringify({ intent, recall_trigger: recallDecision.reason, recall_mode: recallDecision.mode, recall_status: recallResult.status, recall_item_count: (recallResult.items || []).length, injected_item_count: (compressed.items || []).length, pre_execution_gate: preExecution, message: text }) ], { encoding: "utf-8" } ).trim(); ``` ### Technical Analysis The project documentation describes the pre-execution gate as mandatory before file edits, code generation, configuration changes, architecture proposals, and other meaningful changes. However, `harness.js` never invokes `pre-execution-gate.js`. Instead, the harness accepts the `pre_execution` property from its input, coerces it to a Boolean, and logs that caller-controlled value as `pre_execution_gate`. This conflates a request assertion with proof that the security check ran. A caller can omit the property to bypass the supposed gate or set it to `true` to generate misleading telemetry without performing any safety or conflict validation. Although execution-like input may cause a placeholder `constraint_query`, that operation is not equivalent to invoking the gate and does not r ...[truncated 1126 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Derive whether a gate is required internally from the classified intent and planned action; do not trust a caller-provided Boolean. - Invoke `pre-execution-gate.js` or its exported function directly for every execution-like request. - Pass a validated execution plan and the recalled constraints into the gate. - Return and log the actual gate result, including whether it ran, its decision, warnings, and blocking reasons. - Stop downstream execution when the gate fails, cannot run, receives malformed data, or returns `proceed: false`. - Represent gate state with explicit values such as `not_required`, `passed`, `blocked`, and `error`. - Protect audit fields from caller control and add integration tests that verify the gate is invoked before every documented action category. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/structured-log.js:12
Finding
Raw user input is emitted to structured logs without redaction<![CDATA[ ## Vulnerability Details **File Location**: `scripts/structured-log.js:12-24` **Vulnerability Type**: Sensitive information exposure through logging **Risk Level**: Medium ### Vulnerable Code ```js const payload = { ts: new Date().toISOString(), intent: parsed.intent || null, recall_trigger: parsed.recall_trigger || null, recall_mode: parsed.recall_mode || null, recall_status: parsed.recall_status || null, recall_item_count: parsed.recall_item_count ?? null, injected_item_count: parsed.injected_item_count ?? null, pre_execution_gate: parsed.pre_execution_gate ?? false, message: parsed.message || null }; process.stdout.write("[memory-harness] " + JSON.stringify(payload) + "\n"); ``` The raw value originates from `scripts/harness.js:46-59`: ```js const logLine = execFileSync( "node", [ path.join(DIR, "structured-log.js"), JSON.stringify({ intent, recall_trigger: recallDecision.reason, recall_mode: recallDecision.mode, recall_status: recallResult.status, recall_item_count: (recallResult.items || []).length, injected_item_count: (compressed.items || []).length, pre_execution_gate: preExecution, message: text }) ], { encoding: "utf-8" } ).trim(); ``` ### Technical Analysis The complete user message is inserted into a structured log record without redaction, minimization, length restriction, or explicit opt-in. Prompts frequently contain source code, access tokens, credentials, personal data, internal project names, and confidential operational details. Writing the record to stdout does not directly transmit it over the network. However, production runtimes commonly capture stdout in centralized logging systems, container logs, CI artifacts, or monitoring services. This can expand the audience, retention period, and storage locations of sensitive prompt content. The documented list of observability fields also does not disclose that full message content is logged. ...[truncated 834 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Remove full prompt bodies from logs by default. - Log a generated request identifier, intent, item counts, timing information, and other non-sensitive metadata instead. - If message logging is explicitly required, make it opt-in and apply allowlist-based field selection. - Redact common secret formats, including API keys, bearer tokens, passwords, private keys, cookies, and connection strings. - Enforce strict length limits and avoid retaining source code or arbitrary user-provided content. - Document all logged fields, retention periods, access controls, and external log destinations. - Configure production logging systems with encryption, least-privilege access, deletion policies, and auditing. - Add tests confirming that representative credentials and personal data never appear in emitted log records. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (17)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The supplied code implements only a narrow entity-detection helper. It scans input for known strings, builds alias-to-canonical mappings, exposes an addEntity function, and can be run from the command line. There is no evidence of a runtime memory harness, no recall stages, no execution gating, no intent classification, no memory compression, no status tracking, and no automatic trigger integration. While entity detection is mentioned in the description and is present here, the overall declared purpose materially overstates what this code chunk actually does.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding
The declared description promises a comprehensive runtime memory harness with three stages: session preflight, triggered recall, and a pre-execution gate, all automatically enforced. In contrast, the supplied code only shows a single JavaScript file for intent classification with some regex lists and fragments of branching logic related to recall modes. It does not clearly implement session preflight, a pre-execution gate, or a full automatic harness. There are references to recall, compression, and status determination, but they are incomplete and embedded in malformed code. The snippet is also syntactically inconsistent, suggesting it would not run as described. This is therefore a material description-versus-behavior mismatch: the actual code is far narrower and likely nonfunctional relative to the declared end-to-end runtime harness.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The declared description describes a broad, automated memory-management harness with multiple stages and analysis features. The supplied code chunk is much narrower: a standalone script that compresses input items by deduplicating and truncating text. While 'memory compression' is one small part of the declared description, the primary purpose and most claimed capabilities are absent from this code. Therefore the description does not accurately represent what this specific code chunk actually does.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The declared description presents a broad, multi-stage runtime memory harness with several recall and memory-management capabilities. The supplied code chunk, however, is limited to a pre-execution checking utility. It performs regex-based safety scanning on plan descriptions, basic conflict detection against textual constraints, and relevance filtering. There is no evidence of memory storage or recall, session preflight, triggered recall, intent classification, entity detection, compression, status tracking, or automatic orchestration. This is a material description-behavior mismatch rather than a mere partial implementation detail.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding
The declared description presents a broad, runtime-enforced memory system with multiple recall stages and operational enforcement. The supplied code is much narrower: it is a standalone JavaScript utility that determines whether recall might be needed from provided input using regex heuristics and entity presence. It does include limited intent classification and entity detection, which partially aligns with the description, but it does not implement the claimed 3-stage harness, automatic runtime orchestration, memory compression, or pre-execution gating. Therefore the description materially overstates the actual behavior of this code chunk.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The declared description describes an active runtime memory harness with substantial behavior: enforcing recall stages, classifying intent, detecting entities, compressing memory, tracking status, and running automatically at specific execution points. The supplied code does not implement any of those mechanisms. It merely accepts CLI input, attempts to parse JSON, copies a handful of fields into a payload with defaults, adds a timestamp, and prints a structured log line. While the log fields are named to resemble the described harness, the code itself only records supplied values and does not perform recall, gating, classification, detection, compression, or trigger management. This is a material mismatch in primary purpose and capabilities.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The declared description promises a substantial runtime memory harness with automatic enforcement and multiple stages of recall behavior. The supplied code does not implement such a harness. It is only a standalone script that accepts input, parses optional JSON, and emits canned responses based on a mode and provided entities. While it loosely relates to recall queries, it lacks the core claimed functionality: there is no runtime integration, no automatic triggering, no classification logic, no compression, and no gating or enforcement. This is a clear material mismatch in primary purpose and implemented capabilities.

Vague Triggers

Medium
Confidence
94% confidence
Finding
The continuation trigger list is broad enough that ordinary conversational phrases like 'continue', 'previous', or their Japanese equivalents may spur unintended memory recall. In a memory harness, false-positive recall can expose prior-session context, user-specific data, or project details when they were not actually needed, increasing privacy and data-minimization risk.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The trigger condition for any implementation, modification, design, or planning request is overly broad for a system that automatically recalls prior memory. Many such requests are self-contained, so treating the category itself as a recall trigger can unnecessarily pull in stale or sensitive context and bias outputs with irrelevant prior decisions. In agent systems, this can cause both privacy leakage and unsafe actioning based on unrelated memory.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill describes writing 'high-signal info' back to memory without any disclosure, consent model, retention policy, or sensitivity filter. That creates a real privacy and governance risk because users may unknowingly cause persistent storage of personal, confidential, or security-relevant information that can later be resurfaced in other contexts.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The skill explicitly describes persisting 'high-signal info' back to memory but provides no user-facing disclosure, consent boundary, retention rule, or description of what categories of data may be stored. In a memory harness, silent writeback can capture sensitive project details, personal information, or operational context that users may not expect to be retained across sessions, increasing privacy and data-governance risk.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The harness forwards raw user-provided text into structured logging via the `message: text` field, which can persist sensitive prompts, secrets, personal data, or other high-value content in logs. In a memory/recall harness, this is more concerning because the component processes broad conversational context and may routinely handle sensitive material, increasing privacy and data-retention risk even if there is no direct code execution issue.

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
The intent patterns are overwhelmingly written for Japanese phrases, while the file-level description simply says it classifies user input into intent categories. This creates a natural-language policy issue because the skill appears to force a specific language/locale behavior without offering user opt-in or documenting that it is intentionally Japan-specific.

Intent-Code Divergence

Medium
Confidence
98% confidence
Finding
The file is described and structured as a pre-execution safety gate, but it never actually blocks execution: `result.proceed` is initialized to `true` and is never changed even when dangerous patterns or conflicts are detected. In a memory/safety harness context, this can create a false sense of enforcement, allowing downstream components to treat warnings as approval and proceed with unsafe actions.

Natural-Language Policy Violations

Low
Confidence
80% confidence
Finding
The natural-language trigger design explicitly enumerates Japanese and English continuation phrases, which creates a language-specific activation policy. The document does not state that these are examples, does not offer user language choice, and does not justify the locale limitation as region-specific.

Missing User Warnings

Low
Confidence
89% confidence
Finding
Structured logging of session_id, turn_id, recall triggers, and related metadata can create a behavioral audit trail that is sensitive even if content is not stored. Without a privacy notice and minimization policy, these logs may enable user tracking, reconstruction of workflows, or correlation across sessions, especially in multi-tenant environments.

Missing User Warnings

Low
Confidence
86% confidence
Finding
The logging section records session identifiers, intent, recall triggers, and execution-gate metadata without any privacy guidance, minimization statement, or retention/access controls. While the fields are mostly metadata rather than raw content, they can still reveal behavioral patterns, project associations, and user activity across sessions, especially when correlated with other telemetry.

Static analysis

No suspicious patterns detected.