T09 · Insecure Skill Coding Practices
- Location
scripts/commit.js:94- Finding
Shell Command Injection Through Git Commit Messages
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This appears to be a legitimate local memory-graph skill, but its persistent personal-data store and unsafe script handling need review before installation.
Install only if you are comfortable maintaining a persistent local memory store. Do not store secrets or sensitive personal details, keep ~/memory private, review files before committing, avoid pushing the git repo unless intentionally private, use --no-qmd until shell invocation is fixed, and do not open generated graph HTML for untrusted graph content until the HTML injection and CDN issues are addressed.
scripts/commit.js:94Shell Command Injection Through Git Commit Messages
scripts/suggest-backfill.js:56Shell Command Injection Through Knowledge-Graph Metadata Passed to QMD
scripts/visualize.js:131Persistent JavaScript Injection in Generated Graph Visualization
scripts/visualize.js:129Unpinned Remote D3 Script Loaded at Visualization Runtime
The description presents a full-featured personal knowledge graph capability used for persistent context, remembering user information, searching what is known, creating/updating nodes, logging activity, discovering connections, and rebuilding indexes. The supplied code chunk does not provide those capabilities. It is a standalone lint script whose primary purpose is validating existing markdown graph nodes and relations, then optionally adding an updated field. While 'periodic memory maintenance' and 'rebuilding indexes' are mentioned in the description, this code only covers a narrow maintenance/validation function and not the main declared behavior. Therefore the description materially overstates and misrepresents what this specific code chunk actually does.
The declared description presents the skill as a markdown/YAML-based personal knowledge graph used for persistent memory operations such as logging, searching, creating/updating entries, backfilling connections, and rebuilding indexes. The supplied code chunk does not perform those core behaviors. Instead, it assumes an already-built SQLite index database exists, queries nodes and relations from that database, and writes an interactive HTML visualization. While visualization could be a supporting feature of a knowledge graph system, it is not represented in the declared purpose, and the storage/access pattern in this code is materially different from the declared markdown-frontmatter model. Therefore this code chunk is a meaningful mismatch with the declared description.
The skill is explicitly designed for persistent cross-session memory and instructs the agent/user to create a durable ~/memory store plus symlink executable scripts into it. In an agent setting, persistent memory can retain sensitive personal data, activity logs, and context across resets or agent switches, increasing privacy and prompt-injection persistence risk if untrusted content is later ingested from those files.
Requires Node.js 22+ (uses built-in node:sqlite). No npm install needed.
# 1. Create the memory directory structure
mkdir -p ~/memory/{graph/{people,projects,concepts,places,tools},log,indexes,backfill,scripts}
# 2. Symlink scripts from the installed skill
The skill instructs the agent to read and write files under ~/memory/, invoke multiple local scripts, and rely on the MEMORY_ROOT environment variable, yet it declares no explicit tool scope or permission boundary. That creates an authorization ambiguity where an agent may perform file-system and environment-sensitive actions without a clearly constrained capability model, increasing the chance of unintended file access or writes.
The trigger language is extremely broad: phrases like needing user context, logging work, creating/updating entries, and periodic maintenance could match many ordinary conversations. In an agent system, that can cause unintended invocation of a skill that persists data across sessions, leading to overcollection of user information or writes the user did not explicitly request.
The skill explicitly directs agents to persist session activity by logging updates and maintaining a long-lived personal knowledge graph. Persistent cross-session storage of user activity, projects, people, and decisions can expose sensitive personal or operational information if stored without consent, minimization, retention limits, or access controls; the broad context of a personal memory graph makes this more dangerous, not less, because it centralizes longitudinal user data.
1. Read the current node
2. Update frontmatter and/or body
3. Update the `updated` field to today's date
4. Add entry to `## Changelog` section if significant
5. Log the update
6. Rebuild indexes: `node ~/memory/scripts/rebuild-indexes.js --incremental`
This skill is designed around persistent storage of user context in ~/memory, including logs and knowledge nodes that survive agent resets and can be shared across agents. Persistence is the core feature, but from a security and privacy perspective it still creates material risk because it accumulates personal data over time without any setup-time notice about sensitivity, retention, or access boundaries.
Follow these steps to scaffold the memory framework from scratch. Requires Node.js 22+ (built-in node:sqlite).
mkdir -p ~/memory/{graph/{people,projects,concepts,places,tools},log,indexes,backfill,scripts}
The setup guide instructs users to initialize a git repository and commit the memory graph, which is explicitly intended to store personal context, people, projects, places, and logs. Without a clear privacy warning or safeguards, users may version sensitive personal data, later sync it to remotes, or expose historical data through commit history that is difficult to fully remove.
The agent integration section encourages moving factual knowledge about people, relationships, projects, and preferences into a shared cross-agent memory system, but does not warn that this increases persistence and sharing across tools or sessions. In this context, the missing privacy boundary is risky because highly personal or relational data may be normalized into long-lived shared storage without informed consent or minimization.
The script assembles and prints the target node's full markdown body plus recent log lines that reference the node, which can expose sensitive personal or operational context to whatever agent, terminal, or downstream tool invokes it. In this skill's context—a persistent personal knowledge graph intended to store user life, projects, people, and decisions—this broad disclosure is particularly risky because a single briefing may aggregate more private data than is necessary for the immediate task.
The script claims 'No external dependencies' even though the produced HTML depends on a third-party CDN for D3.js. This misleading documentation can cause users to open the visualization assuming it is fully local/offline, increasing the chance they unknowingly expose usage metadata or execute untrusted third-party code when viewing sensitive personal-memory data.
The generated HTML loads D3.js from a public CDN at runtime, which introduces a supply-chain and privacy risk. If the CDN resource is tampered with, blocked, or replaced in transit or by a compromised upstream, opening the local graph can execute attacker-controlled JavaScript in the browser and expose sensitive memory-graph contents rendered by the page.
The markdown describes commit.js as automatically committing changes and later shows node ~/memory/scripts/commit.js as an example. Because this affects version-controlled user data, the README should explicitly warn users that it will create git commits and may include any current changes in the memory directory.
The page loads D3 directly from a third-party CDN without any integrity pinning, local vendoring, or user disclosure. If the CDN response is tampered with, blocked, or swapped, arbitrary JavaScript would execute in the page context; in a memory-graph skill that may expose potentially sensitive personal knowledge graph data rendered in the browser.
Detected: suspicious.dangerous_exec