Back to skill

Security audit

collective-memory

Security checks for vulnerabilities and agentic risk

Overview

This skill has a coherent purpose, but it can broadly and persistently rewrite agent memory files across workspaces with weak path and matching safeguards.

Use this only for non-sensitive notes and only with explicit target lists or dry-run previews. Avoid broadcasting secrets, secret paths, account details, or instructions that could change future agent behavior unless every target is intentional and reviewed. Treat auto-discovery and custom filenames as risky until the script enforces path containment, safer heading matching, confirmation, and rollback.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/update_memory.py:122
Finding

Unrestricted Destination Path and Symlink Traversal Enable Arbitrary File Modification

Content
View full analysis
Tuple[str, str]: """ Upsert content into /. Returns (action, filepath_str) where action ∈ {"updated", "appended", "would_update", "would_append"}. """ filepath = Path(workspace) / filename if not filepath.exists(): if not dry_run: filepath.parent.mkdir(parents=True, exist_ok=True) filepath.write_text(f"# {filename.replace('.md', '')}\n\n", encoding="utf-8") # When dry-run on a non-existing file, treat as "would_append" return ("would_append" if dry_run else "appended", str(filepath)) raw = filepath.read_text(encoding="utf-8") lines = raw.splitlines(keepends=True) heading_line = match_by_heading(lines, key) if heading_line is not None: if dry_run: return ("would_update", str(filepath)) start, end = get_section_range(lines, heading_line) lines[start:end] = [content.rstrip("\n") + "\n"] filepath.write_text("".join(lines), encoding="utf-8") return ("updated", str(filepath)) if dry_run: return ("would_append", str(filepath)) suffix = "\n" if raw and not raw.endswith("\n") else "" filepath.write_text(raw + suffix + "\n" + content.rstrip("\n") + "\n", encoding="utf-8") return ("appended", str(filepath)) ``` ### Technical Analysis The destination is formed directly from an accepted workspace and an unvalidated filename: ```python filepath = Path(workspace) / filename ``` The implementation does not reject absolute filenames, `..` traversal components, or destinations reached through symbolic links. With `pathlib`, an absolute right-hand ...[truncated 1978 chars]
Remediation
View remediation

T02 · Agent Memory Poisoning

Error
Location
scripts/update_memory.py:55
Finding

Overbroad Heading Matching Can Poison or Destroy Persistent Agent Memory

Content
View full analysis
List[str]: """ Mixed-language tokenizer. English/digit runs: kept as a single lowercased token if length >= 1 (changed from >= 2 in v1.0.0 of the internal version — single-char English keys like "a" / "v" / "y" now match correctly). CJK runs: any 2+ contiguous CJK char span becomes one token; single CJK chars are dropped because they are too ambiguous. """ tokens: List[str] = [] for seg in re.findall(r"[A-Za-z0-9]+", text): if len(seg) >= 1: tokens.append(seg.lower()) for seg in re.findall(r"[\u4e00-\u9fff]{2,}", text): tokens.append(seg) return tokens ``` ```python def match_by_heading(lines: List[str], key: str) -> Optional[int]: """Find first heading line whose text contains any token from `key`.""" tokens = tokenize(key) if not tokens: tokens = [key.lower()] for line_no, title in extract_headings(lines): title_lower = title.lower() if any(tok in title_lower for tok in tokens): return line_no return None ``` ```python if heading_line is not None: if dry_run: return ("would_update", str(filepath)) start, end = get_section_range(lines, heading_line) lines[start:end] = [content.rstrip("\n") + "\n"] filepath.write_text("".join(lines), encoding="utf-8") return ("updated", str(filepath)) ``` ### Technical Analysis The matching algorithm performs substring-based OR matching against every heading. Every English or numeric run is accepted as a token, including single-character tokens. A heading is selected when any token appears anywhere in the heading text. This behavior creates several unsafe conditions: - A key such as ...[truncated 2202 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
README.md:25
Finding

Unpinned npx Installer Introduces Supply-Chain Execution Risk

Content
View full analysis
Remediation
View remediation
install collective-memory ``` 2. Document the expected publisher, registry, package digest, and release provenance. 3. Prefer an installation method that verifies a cryptographic checksum or signed release artifact. 4. Use lockfiles and integrity metadata where the installer is incorporated into automated setup. 5. Recommend reviewing the package and its dependency tree before execution. 6. Avoid running the installer with elevated privileges. 7. For high-assurance environments, provide a verified offline installation artifact and checksum. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (12)

Ssd 3

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The documentation explicitly frames the tool as a way to propagate memory notes like an API key path across all agent workspaces, normalizing broad disclosure of secret-related operational details. Even if it does not copy the secret value itself, distributing locations, filenames, and handling instructions across many workspaces materially increases exposure and can aid later compromise or unintended leakage through those agents' memory files.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The quick-start phrasing encourages invocation via broad natural-language commands like 'broadcast this to all my agents', which can plausibly overlap with ordinary conversation and trigger the skill unintentionally. Because this skill performs bulk writes across multiple workspaces, accidental activation can propagate incorrect, sensitive, or misleading content widely before the user notices.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The concrete example command demonstrates broadcasting a note titled 'API key path' to multiple targets, implicitly endorsing wide replication of sensitive configuration knowledge. In agent-memory files, this information can be surfaced, indexed, summarized, or copied later, so a single mistaken broadcast can increase the blast radius of sensitive infrastructure details across many projects.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · README.md (reported line 53)May include surrounding context.

md
--target ~/code/proj-c:MEMORY.md \
  --key   "API key path" \
  --content "## API key path
stored in .secrets/api-keys.env (chmod 600)"

# Auto-discover all subdirs of two parents
python3 <skill-install-path>/scripts/update_memory.py \

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The listed trigger phrases are very generic, including variants like 'remember this everywhere' and 'make all my agents know', which may appear in normal user conversation. In the context of a file-writing skill that can auto-discover many targets, ambiguous triggers raise the risk of unintended bulk modification and cross-workspace propagation of sensitive or incorrect notes.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill performs broad file read/write operations across multiple workspaces, but it declares no explicit tool scope or permission boundaries. In an agent runtime, this increases the chance the skill is invoked with excessive filesystem privileges and can modify memory files in unintended projects.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger phrases are very broad, including common natural-language requests like 'remember this everywhere' and 'tell every agent', which can overlap with ordinary conversation. This raises the risk of accidental activation and unintended propagation of content into persistent memory files across many workspaces.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
88% confidence
Finding

The skill explicitly skips confirmation for a single target, allowing autonomous persistent writes based solely on the agent's interpretation of user intent. Because the operation alters long-lived memory files, a mistaken parse or prompt-injection-influenced request could change agent behavior without an explicit user approval step.

Content

Scanner excerpt · SKILL.md (reported line 95)May include surrounding context.

Proceed? (y/n)

text

Single target → skip confirmation, run directly.

**Sensitive content guard**: if `content` contains `token`, `password`,
`secret`, `api_key`, `private_key`, or `_token=` patterns, **always** add a

Session Persistence

Medium
Category
Rogue Agent
Confidence
91% confidence
Finding

The skill is designed to persist content across multiple agent workspaces by writing to files like MEMORY.md, AGENTS.md, TOOLS.md, and USER.md. This creates durable cross-project state, so if sensitive, malicious, or incorrect content is broadcast, it can influence future agent sessions and propagate harmful instructions or secrets widely.

Content

Scanner excerpt · SKILL.md (reported line 100)May include surrounding context.

md
**Sensitive content guard**: if `content` contains `token`, `password`,
`secret`, `api_key`, `private_key`, or `_token=` patterns, **always** add a
red warning line to the confirmation prompt:
> ⚠️ This memory contains apparent secrets. Broadcasting will write to every
> target. Are you sure? (y/n)

---

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SKILL.md (reported line 127)May include surrounding context.

--target /path/to/ws3:MEMORY.md
--key "API key path"
--content "## API key path stored in .secrets/api-keys.env (chmod 600)"

text

**Auto-discover form:**

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/update_memory.py (reported line 5)May include surrounding context.

python
"""
collective-memory: broadcast a single memory note to multiple agent workspaces.

Pure file-ops, zero network, zero LLM. The calling agent decides what to write
and which key to look up; this script does the file work atomically.

Match strategy (idempotent two-step):