T01 · Skill Instruction Hijacking
- Location
SKILL.md:3- Finding
Mandatory Session-Wide Behavior Override Through Always-On Skill Instructions
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a coherent knowledge-graph tool, but it tries to affect all Markdown work and contains an unbounded path-handling flaw in its mindskill commands.
Review before installing. This skill is not showing malicious exfiltration or destructive behavior, but it can influence ordinary Markdown edits, index broad workspace notes, and create persistent files. Only use it in workspaces where Obsidian-style wikilinks are desired, and avoid passing untrusted or path-like names to mindskill commands until path validation is added.
SKILL.md:3Mandatory Session-Wide Behavior Override Through Always-On Skill Instructions
scripts/mindgraph.py:449Path Traversal in MindSkill Read and Creation Commands
Mandating wikilinks as 'standard practice in every markdown file' is an ambiguous global instruction with no directory, project, or task boundaries. This can silently alter unrelated documentation, introduce formatting changes where they are inappropriate, and cause the agent to prioritize skill-specific conventions over the user's immediate intent or repository norms.
Mandating wikilinks as 'standard practice in every markdown file' is an ambiguous global instruction with no directory, project, or task boundaries. This can silently alter unrelated documentation, introduce formatting changes where they are inappropriate, and cause the agent to prioritize skill-specific conventions over the user's immediate intent or repository norms.
The skill instructs the agent to save result files under the workspace and rebuild an index, but does not prominently warn that these steps perform writes and may modify repository state. In practice, this can lead to non-obvious persistence, accidental file creation, and workspace-wide index churn without explicit user awareness or consent.
The listed triggers include generic phrases such as "Should I build X?", "Validate this idea", and "Is this worth building?" that could easily occur in ordinary conversation outside a deliberate invocation context. The file does not provide narrowing constraints, exclusions, or negative examples to clarify when the skill should and should not activate.
Line L20 says the process is encoded and 'just say "knockout test this" and it executes.' For a markdown file, this is an invocation description, and the phrase is broad enough to be ambiguous without constraints, scope, or negative examples. The document does not clarify when this trigger should or should not activate.
The script writes a graph index to mindgraph.json in the workspace, and this behavior is not accompanied by any confirmation prompt or explicit warning before the write occurs. Although the operation is central to the index command, the file write itself can modify user workspace state and should be clearly disclosed at the point of action or in surrounding documentation/comments.
Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.
'linkCount': sum(len(n['outLinks']) for n in nodes.values())
}
with open(GRAPH_FILE, 'w') as f:
json.dump(graph, f, indent=2)
file_nodes = sum(1 for n in nodes.values() if n['file'])
The top-level docstring describes the script as an Obsidian-style wikilink graph that indexes, queries, and traverses markdown links. Starting at L407, the code adds a separate capability for creating, listing, and reading 'mindskills' and their results, including writing new PROCESS.md files, which is beyond the stated graph-focused behavior.
Creating directories and files without confirmation becomes security-relevant here because the destination path is derived from unvalidated user input. In the context of cmd_learn, an attacker-controlled or mistaken name can cause unintended filesystem writes outside the intended skill area, making the file-creation behavior materially dangerous.
The learn command uses the unvalidated user-supplied name to construct skill_dir/process_file and then writes PROCESS.md. Because name is passed directly into os.path.join without sanitization, path traversal values such as '../../somewhere' can escape the intended mindskills directory and create or overwrite arbitrary files accessible to the current user.
os.makedirs(os.path.join(skill_dir, 'results'), exist_ok=True)
process_file = os.path.join(skill_dir, 'PROCESS.md')
with open(process_file, 'w') as f:
f.write(f"""# [[{name.replace('-', ' ').title()}]]
<!-- PURPOSE: What this process does and when to use it -->
The docstring says 'Find links pointing to nothing (no file, no other references),' which implies zero references. The actual filter requires len(n.get('inLinks', [])) == 1, meaning the node has one reference, so the documentation actively misstates the behavior of the command.
No suspicious patterns detected.