Back to skill

Security audit

Obsidian Direct

Security checks for vulnerabilities and agentic risk

Overview

This Obsidian note-management skill is mostly coherent, but its create-note command can be directed to write Markdown files outside the configured vault.

Install only if you are comfortable giving the skill read and write access to your Obsidian Markdown vault. Before use, fix or constrain the create-note folder handling so folders cannot contain absolute paths or '..' traversal, and prefer explicit confirmation before create, replace, clear, or section-rewrite operations.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/obsidian_cli.py:196
Finding

Vault Boundary Escape Through Unvalidated Folder Path

Content
View full analysis
Path: """Create a new note.""" if auto_folder and not folder: folder = suggest_folder(vault, content, title) # Determine path if folder: note_dir = vault / folder note_dir.mkdir(parents=True, exist_ok=True) else: note_dir = vault # Sanitize filename safe_title = re.sub(r'[<>:"/\\|?*]', '', title) note_path = note_dir / f"{safe_title}.md" # Build frontmatter fm = { 'created': datetime.now().isoformat(), } if tags: fm['tags'] = tags full_content = format_frontmatter(fm) + content note_path.write_text(full_content, encoding='utf-8') ``` ### Technical Analysis The `folder` argument is user-controlled and is joined directly to the configured vault path without normalization or containment validation. Sanitizing only the note title does not protect the directory component. A relative value containing parent-directory components, such as `../../target`, causes the destination to resolve outside the vault. A supplied absolute path can also override the vault prefix under `pathlib` path-joining semantics. The function subsequently creates directories with `mkdir()` and writes content with `write_text()`. Because `write_text()` overwrites an existing file by default, an attacker can create or replace `.md` files anywhere writable by the process. The vulnerability does not bypass operating-system permissions, but it violates the application's intended vault boundary and grants filesystem-write scope beyond the legitimate note-management task. ### Attack Path 1. An attacker supplies or induces an agent to use a crafted fold ...[truncated 1300 chars]
Remediation
View remediation
Path: vault_resolved = vault.resolve() if not folder: return vault_resolved supplied = Path(folder) if supplied.is_absolute(): raise ValueError("Absolute folder paths are not allowed") destination = (vault_resolved / supplied).resolve() if not destination.is_relative_to(vault_resolved): raise ValueError("Folder must remain inside the configured vault") return destination ``` Use the validated path and prevent implicit overwrites: ```python note_dir = resolve_inside_vault(vault, folder) note_dir.mkdir(parents=True, exist_ok=True) note_path = (note_dir / f"{safe_title}.md").resolve() if not note_path.is_relative_to(vault.resolve()): raise ValueError("Note path escapes the configured vault") with note_path.open("x", encoding="utf-8") as output: output.write(full_content) ``` If overwriting is required, expose a deliberate `--overwrite` option and require explicit authorization. Where untrusted users can modify the vault, also account for symlink races by using platform-appropriate secure file-opening controls and running the skill under a minimally privileged account. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (9)

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

Most of the declared description matches the code well: it works on an Obsidian vault, supports create/read/edit operations, frontmatter handling, folder suggestion, tag extraction, and wikilink analysis. There is no obvious undeclared dangerous capability beyond vault file access. The main mismatch is that the description specifically claims fuzzy/phonetic search across all notes, but this code chunk does not implement that behavior directly; it imports search_vault from a separate obsidian_search module, so the claimed search behavior is not verifiable from the supplied chunk. Additionally, the docstring mentions edit actions like rewrite while the actual parser supports append/prepend/replace/replace-section/clear, which is a minor description/behavior inconsistency. Overall, this is a partial mismatch rather than a materially different tool.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents a broader Obsidian vault management skill, including note creation, reading, editing, frontmatter manipulation, auto-folder detection, and tag/wikilink management. The supplied code only implements search over markdown files already in the vault. It reads files, optionally parses YAML frontmatter, uses ripgrep/grep plus fuzzy/phonetic scoring, and returns ranked search results with context. While the search portion aligns with the declared fuzzy/phonetic search feature, the chunk lacks the other core declared behaviors. Because the description suggests a multipurpose vault CRUD/organization tool while the code is only a search component, the description does not accurately represent what this specific code chunk actually does.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill exposes shell, environment, file read, and file write capabilities through documented CLI commands, but it does not declare any explicit tool scope or allowed-tools boundary. This weakens policy enforcement and increases the chance the agent invokes powerful capabilities implicitly when handling ordinary knowledge-base requests.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The description presents the skill as a knowledge-base helper but does not prominently warn that it can create and edit files in the user's vault. Users or orchestrators may treat it as read-oriented search functionality and unknowingly permit destructive or privacy-impacting actions, especially given the predefined vault path.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The activation text is broad enough to match generic note-taking, document-saving, or editing requests, which could cause the skill to engage outside a clearly bounded Obsidian context. Because the skill can write to the user's vault, over-broad triggering raises the risk of unintended file modification or disclosure of vault contents.

Content

No source excerpt is available for this finding.

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding

Suspicious Unicode normalization or mixed-script content

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/obsidian_search.py (reported line 81)May include surrounding context.

python
try:
        # Search for any of the query words (case-insensitive)
        pattern = '|'.join(re.escape(w) for w in words)
        result = subprocess.run(
            ['rg', '-l', '-i', '--type', 'md', pattern, vault_path],
            capture_output=True, text=True, timeout=10
        )

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/obsidian_search.py (reported line 93)May include surrounding context.

python
# Fallback to grep
    try:
        pattern = '|'.join(re.escape(w) for w in words)
        result = subprocess.run(
            ['grep', '-ril', '-E', pattern, '--include=*.md', vault_path],
            capture_output=True, text=True, timeout=30
        )

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The skill's prompt examples are exclusively in Russian, which can imply a fixed language expectation without offering a user choice. The policy requires avoiding forced language or locale constraints unless they are clearly justified or optional.

Content

No source excerpt is available for this finding.