Back to skill

Security audit

AI研究保存到Obsidian

Security checks for vulnerabilities and agentic risk

Overview

This skill has a coherent note-saving purpose, but it deserves review because it can open third-party AI sites and move generated files into an Obsidian vault without firm confirmation or safe file-move guidance.

Install only if you are comfortable sending research queries to the named AI services and saving generated notes into your Obsidian vault. Before use, specify the exact vault and folder, review the Markdown first, and use safe file handling rather than a raw unquoted mv command.

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

Warning
Location
SKILL.md:48
Finding

Unsafe Shell Path Interpolation in File Move Operation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 48–51
Vulnerability Type: Unquoted shell arguments enabling command injection and unsafe file operations
Risk Level: Medium

Vulnerable Code

bash
mv <源文件> <Obsidian路径>/

Technical Analysis

The workflow instructs the agent to substitute a source filename and an Obsidian vault path directly into a shell command without quoting either operand or separating arguments safely.

File and directory names can contain whitespace, shell metacharacters, command substitutions, or option-like prefixes. If substituted into a shell command as written, these values may be split into multiple arguments or interpreted as shell syntax. In addition, the command does not use -- to prevent filenames beginning with - from being interpreted as options.

The destination is discovered from the local environment or may be supplied by the user. The workflow does not require canonicalizing the path, confirming that it belongs to the intended vault, checking for symbolic-link redirection, or preventing an existing file from being overwritten.

Attack Path

  1. An attacker influences the source filename or provides a crafted Obsidian vault path.
  2. The crafted value includes whitespace, shell metacharacters, command substitution syntax, or an option-like prefix.
  3. The agent replaces the placeholders in the documented mv command without safe argument handling.
  4. The shell interprets part of the path as syntax, additional arguments, or command options.
  5. Commands execute with the agent process's privileges, or files are moved to or overwrite unintended locations.

Actual exploitability depends on whether the executing agent interpolates the values into a shell command as documented and whether an attacker can influence either path.

Impact Assessment

Successful shell injection could execute arbitrary commands with the privileges of the agent process. This could expose, alter, or delete files ...[truncated 420 chars]

Remediation
View remediation

Remediation Suggestions

  • Prefer a structured file-operation API that accepts the source and destination as separate arguments rather than constructing a shell command.
  • If shell execution is unavoidable, assign paths to variables and quote every expansion:
bash
source_path="..."
vault_path="..."
mv -n -- "$source_path" "$vault_path/"
  • Validate and canonicalize both paths before moving the file.
  • Verify that the canonical destination remains within an explicitly approved Obsidian vault.
  • Reject unexpected control characters and other unsafe path content.
  • Check for symbolic links in destination path components where redirection would violate the intended boundary.
  • Use -n or require explicit confirmation before replacing an existing file.
  • Confirm that the source is a regular file and that the destination directory exists before performing the operation.
  • Execute the operation with only the minimum filesystem permissions required.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (4)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The trigger conditions include a very broad everyday phrase ('帮我查一下') combined with generic note-saving intent, which can cause the skill to activate in situations the user did not clearly intend. Because this skill performs external browsing and file-writing actions, accidental invocation increases the chance of unintended data collection, note creation, or writes into an Obsidian vault.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill instructs the agent to create files, discover local Obsidian vault paths, and move content into the vault without an explicit user risk notice or confirmation checkpoint. This is dangerous because it combines external content ingestion with local filesystem writes, which may overwrite user expectations, place sensitive or untrusted content into synced notes, or target unintended vault locations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The template includes fixed Chinese headings and labels such as "来源", "核心要点", "详细内容", and "参考信息", which imposes a specific language on generated content. This is a natural-language locale policy concern because the file does not offer any user opt-in, language selection, or justification for requiring Chinese.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

L82 写明“优先使用豆包(中文理解最好)”,这在自然语言层面引导固定语言/模型偏好,而没有说明应根据用户语言偏好选择。对于多语言用户或英文场景,这种默认中文优先可能违反语言/地区选择应由用户决定的政策要求。

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.