Back to skill

Security audit

Obsidian-Git-Vault

Security checks for vulnerabilities and agentic risk

Overview

The skill largely matches its stated Obsidian-and-Git purpose, but its optional auto-sync can create a recurring agent task and its Git workflow can rewrite remote history after broad consent.

Install only if you want an agent to manage an Obsidian vault with Git. Avoid enabling the cron helper unless you have reviewed the exact scheduled message, interval, vault path, remote, and how to disable it. Treat force-with-lease as a manual recovery action and confirm the exact branch and remote before allowing it.

Vulnerability Patterns
  • System PersistenceInstalls backdoors, hooks, services, or scheduled tasks that survive the run
  • 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)

T06 · System Persistence

Warning
Location
scripts/openclaw-cron-vault-sync.sh:3
Finding

Persistent Environment-Controlled OpenClaw Scheduled Agent Task

Content
View full analysis

Vulnerability Details

File Location: scripts/openclaw-cron-vault-sync.sh, lines 3-18
Vulnerability Type: Persistent scheduled task with an environment-controlled Agent instruction
Risk Level: Medium

Vulnerable Code

bash
TZ="${OBSIDIAN_CRON_TZ:-Asia/Shanghai}"
NAME="${OBSIDIAN_CRON_NAME:-obsidian-vault-sync}"
EXPR="${OBSIDIAN_CRON_EXPR:-0 */2 * * *}"
MSG="${OBSIDIAN_CRON_MESSAGE:-按 obsidian-git-vault skill:对默认/当前 vault 执行 scripts/vault-sync.sh(先 resolve);失败则报告并停止;强推仅当已接受 SOP 且 OBSIDIAN_SOP_FORCE_LEASE=1。}"

if ! command -v openclaw >/dev/null 2>&1; then
    echo "未找到 openclaw 命令,跳过 cron 注册。" >&2
    exit 1
fi

openclaw cron add \
    --name "$NAME" \
    --cron "$EXPR" \
    --tz "$TZ" \
    --session isolated \
    --message "$MSG"

Related workflow documentation appears in vault-sync-sop.md, lines 8-30, and requires written user consent before registration.

Technical Analysis

The script calls openclaw cron add to install a recurring task that remains active beyond the current Skill execution. By default, it starts an isolated OpenClaw session approximately every two hours. This is a cross-session persistence mechanism and therefore falls under system persistence, even though scheduled synchronization is part of the declared optional functionality.

The schedule, task name, time zone, and—most importantly—the future Agent instruction are accepted from environment variables. An actor capable of influencing OBSIDIAN_CRON_MESSAGE when the setup script is invoked can persist an alternative instruction for execution in later Agent sessions. The task is not itself a conventional shell backdoor, but its stored message can direct future Agent activity within the permissions available to those sessions.

The surrounding documentation materially reduces the likelihood of unauthorized installation: it requires prior written user consent, limits setup to environments with ...[truncated 2370 chars]

Remediation
View remediation

Remediation Suggestions

  1. Do not register the task automatically. Print the fully resolved openclaw cron add command and require the user to review and execute it manually.
  2. Remove support for arbitrary OBSIDIAN_CRON_MESSAGE values. Use a fixed, narrowly scoped synchronization instruction maintained in the reviewed Skill package.
  3. If customization is necessary, restrict it to an allowlisted set of synchronization options rather than accepting free-form Agent instructions.
  4. Display the exact task name, schedule, time zone, target vault, remote destination, and stored message, then require explicit final confirmation immediately before registration.
  5. Validate the cron expression and enforce a safe minimum interval to prevent unexpectedly frequent execution.
  6. Add explicit task inspection, disablement, and removal commands to the setup output and documentation.
  7. Prefer a task with an expiration time or bounded execution count where OpenClaw supports those controls.
  8. Ensure scheduled sessions run with the minimum filesystem and network privileges required for the selected vault and configured Git remote.
  9. Preserve the existing requirement for prior written user consent and make it an enforceable setup step rather than a documentation-only safeguard.
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (21)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
`SKILL_ROOT` 指含本 `SKILL.md` 的目录(openclaw 内多为 `.cursor/skills/obsidian-git-vault`)。优先用脚本代替手写长命令:

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
87% confidence
Finding

Permitting force-push semantics via an SOP exception is dangerous because it can overwrite remote history and erase collaborators' work, and the policy invites the model to trust another file's workflow over its local safety language. In this context, the skill manages personal notes, but it also supports remotes like GitHub/GitLab, so the blast radius includes synchronized repositories and backups.

Content

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

md
| 撤销未提交修改 | `git restore 路径`(丢弃工作区改动前需用户确认) |
| 取消暂存 | `git restore --staged 路径` |

**高风险**:`git reset --hard`、裸 `git push --force`、`git rebase` 等——默认仅用户 **逐字明确要求** 时执行。若用户 **已采用** [vault-sync-sop.md](vault-sync-sop.md),则其中写明的「本地领先时推送 / `push --force-with-lease`」条件 **优先于** 本句的保守默认。

不要直接编辑 `.git` 目录内文件;不把 `.git` 当笔记检索。

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
87% confidence
Finding

Permitting force-push semantics via an SOP exception is dangerous because it can overwrite remote history and erase collaborators' work, and the policy invites the model to trust another file's workflow over its local safety language. In this context, the skill manages personal notes, but it also supports remotes like GitHub/GitLab, so the blast radius includes synchronized repositories and backups.

Content

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

md
| 撤销未提交修改 | `git restore 路径`(丢弃工作区改动前需用户确认) |
| 取消暂存 | `git restore --staged 路径` |

**高风险**:`git reset --hard`、裸 `git push --force`、`git rebase` 等——默认仅用户 **逐字明确要求** 时执行。若用户 **已采用** [vault-sync-sop.md](vault-sync-sop.md),则其中写明的「本地领先时推送 / `push --force-with-lease`」条件 **优先于** 本句的保守默认。

不要直接编辑 `.git` 目录内文件;不把 `.git` 当笔记检索。

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
87% confidence
Finding

Permitting force-push semantics via an SOP exception is dangerous because it can overwrite remote history and erase collaborators' work, and the policy invites the model to trust another file's workflow over its local safety language. In this context, the skill manages personal notes, but it also supports remotes like GitHub/GitLab, so the blast radius includes synchronized repositories and backups.

Content

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

md
| 撤销未提交修改 | `git restore 路径`(丢弃工作区改动前需用户确认) |
| 取消暂存 | `git restore --staged 路径` |

**高风险**:`git reset --hard`、裸 `git push --force`、`git rebase` 等——默认仅用户 **逐字明确要求** 时执行。若用户 **已采用** [vault-sync-sop.md](vault-sync-sop.md),则其中写明的「本地领先时推送 / `push --force-with-lease`」条件 **优先于** 本句的保守默认。

不要直接编辑 `.git` 目录内文件;不把 `.git` 当笔记检索。

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · git-remote-wizard.md (reported line 122)May include surrounding context.

md
### 5.1 SSH(推荐长期自用)

- **凭据形态**:本机 `~/.ssh/id_ed25519`(或 rsa)公钥登记到 GitHub/GitLab。
- **权限收敛**:密钥 **只加在个人账户**,仓库用 **私有** 若笔记敏感;Deploy Key 仅绑定单一仓库、只读或读写按需要选。
- **Agent 说明要点**:私钥不出库、不贴进聊天;远程 URL 用 `git@host:...`,不要在笔记仓提交任何密钥文件。

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · git-remote-wizard.md (reported line 126)May include surrounding context.

md
- **权限收敛**:密钥 **只加在个人账户**,仓库用 **私有** 若笔记敏感;Deploy Key 仅绑定单一仓库、只读或读写按需要选。
- **Agent 说明要点**:私钥不出库、不贴进聊天;远程 URL 用 `git@host:...`,不要在笔记仓提交任何密钥文件。

### 5.2 HTTPS + PAT(Personal Access Token)

- **权限收敛(GitHub 示例)**:勾选 **repo**(私有库读写)即可;**不要**勾选 `delete_repo`、workflow、整账户 admin,除非用户明确需要。
- **GitLab**:`write_repository` / `read_repository` 按私有与只读需求选最小集。

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/init-default-vault.sh (reported line 16)May include surrounding context.

sh
desktop.ini

# 本地密钥与环境变量(勿提交)
.env
.env.*
*.pem
*.key

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The SOP allows git push --force-with-lease after a push rejection under the umbrella of prior SOP adoption, but it does not prominently warn that this can rewrite remote branch history and discard collaborators' work. In an agentic workflow, normalizing force-push behavior materially increases the risk of destructive remote changes from ambiguous or stale context.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
97% confidence
Finding

This duplicate finding points to the same unsafe parameterization: the SOP explicitly endorses git push --force-with-lease as a fallback when normal push is rejected. Even though it is safer than bare --force, it still enables history rewriting and potential loss of collaborators' commits if used from an automated agent flow with incomplete situational awareness.

Content

Scanner excerpt · vault-sync-sop.md (reported line 74)May include surrounding context.

md
| 情形 | 动作 |
|------|------|
| 与远程无提交差、工作区干净(或已 commit) | **停止** 同步操作(无需 push/pull)。 |
| **仅本地领先**(有本地提交未推送) | 在用户已同意本 SOP 前提下 **`git push`**;若远程因历史分歧拒绝,再按用户策略使用 **`git push --force-with-lease`**(优先于裸 `--force`)。 |
| **仅远程领先** | **`git pull`**(或用户偏好的 `git pull --rebase`);随后处理冲突见第 3 步。 |
| **双方各有提交**(分叉) | 先向用户 **告警**;再拉取合并或 rebase;仍冲突则走第 3 步。 |

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
97% confidence
Finding

This duplicate finding points to the same unsafe parameterization: the SOP explicitly endorses git push --force-with-lease as a fallback when normal push is rejected. Even though it is safer than bare --force, it still enables history rewriting and potential loss of collaborators' commits if used from an automated agent flow with incomplete situational awareness.

Content

Scanner excerpt · vault-sync-sop.md (reported line 74)May include surrounding context.

md
| 情形 | 动作 |
|------|------|
| 与远程无提交差、工作区干净(或已 commit) | **停止** 同步操作(无需 push/pull)。 |
| **仅本地领先**(有本地提交未推送) | 在用户已同意本 SOP 前提下 **`git push`**;若远程因历史分歧拒绝,再按用户策略使用 **`git push --force-with-lease`**(优先于裸 `--force`)。 |
| **仅远程领先** | **`git pull`**(或用户偏好的 `git pull --rebase`);随后处理冲突见第 3 步。 |
| **双方各有提交**(分叉) | 先向用户 **告警**;再拉取合并或 rebase;仍冲突则走第 3 步。 |

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

整个技能文件以中文固定描述行为与交互预期,但没有说明这是面向特定中文用户群的限定,也没有提供按用户偏好切换语言的选项。按规则,强制特定语言而无用户 opt-in 可构成自然语言政策违规。

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

L005 用一长串自然语言主题词描述“当用户提及…时触发”,其中包含“笔记检索、新建笔记、改笔记、Git、版本、提交、推送、拉取、远程”等高频、泛化词汇,但没有给出明确的触发短语集合、排除条件或负例。这会让技能在普通讨论 Git、笔记或同步方案时也可能被调用,属于 markdown/manifest 文件中的模糊触发条件。

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
72% confidence
Finding

Because the skill persists a conventional vault location across sessions, an attacker who can influence files in that directory or induce the user to create it can increase the chance of unintended future operations there. The skill does include path-boundary checks, which reduces severity, but it does not eliminate the risk of stale-context writes or Git actions against an implicitly selected repository.

Content

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

md
3. 当前 Cursor **工作区根目录**:若根下存在 `.obsidian` 目录,可视为 vault 根。
4. **约定默认目录**:`~/.openclaw/workspace/obsidian-git-vault`(即 `$HOME/.openclaw/workspace/obsidian-git-vault`)在磁盘上已存在时作为 vault 根。

若以上皆无效:向用户索要 vault 绝对路径,或说明可 `mkdir -p ~/.openclaw/workspace/obsidian-git-vault` 后作为默认库再操作。禁止把上述列表以外的路径当作默认去猜。禁止操作落在所选 vault 根以外的未授权路径(防路径穿越)。

下文记 `V="<vault 绝对路径>"`,命令统一写 `git -C "$V"`。

Session Persistence

Medium
Category
Rogue Agent
Confidence
72% confidence
Finding

Because the skill persists a conventional vault location across sessions, an attacker who can influence files in that directory or induce the user to create it can increase the chance of unintended future operations there. The skill does include path-boundary checks, which reduces severity, but it does not eliminate the risk of stale-context writes or Git actions against an implicitly selected repository.

Content

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

md
3. 当前 Cursor **工作区根目录**:若根下存在 `.obsidian` 目录,可视为 vault 根。
4. **约定默认目录**:`~/.openclaw/workspace/obsidian-git-vault`(即 `$HOME/.openclaw/workspace/obsidian-git-vault`)在磁盘上已存在时作为 vault 根。

若以上皆无效:向用户索要 vault 绝对路径,或说明可 `mkdir -p ~/.openclaw/workspace/obsidian-git-vault` 后作为默认库再操作。禁止把上述列表以外的路径当作默认去猜。禁止操作落在所选 vault 根以外的未授权路径(防路径穿越)。

下文记 `V="<vault 绝对路径>"`,命令统一写 `git -C "$V"`。

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The usage/help text is entirely in Chinese, and the rest of the script's status and error messages follow the same pattern. For a general-purpose sync script, this imposes a specific language on users without opt-in or documented regional justification, which matches the locale-policy violation criteria.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This SOP authorizes creating a default vault directory, initializing a Git repository, writing a .gitignore, and creating or modifying notes as part of an automated workflow. Even though parts mention user consent, the document does not require a clear per-action confirmation before state-changing operations, which can lead to unintended local persistence and repository changes in a user environment.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
88% confidence
Finding

The instruction to create ~/.openclaw/workspace/obsidian-git-vault establishes persistent state in the user's home directory without a strong safeguard limiting when that state is created. Persistent directories can outlive the session, accumulate data unexpectedly, and cause later automation to operate on stale or unintended repositories.

Content

Scanner excerpt · vault-sync-sop.md (reported line 41)May include surrounding context.

md
- 用主 [SKILL.md](SKILL.md) 第 1 节解析 `$V`。
- **若目标笔记路径在本地已存在**:进入第 2 步。
- **若不存在**:走 **默认库初始化**(用户未另指定时):
  - `mkdir -p ~/.openclaw/workspace/obsidian-git-vault`(若缺则建);
  - 将 `$V` 定在该目录;
  - `git rev-parse` 非仓库则 **`git init`**(用户同意时);
  - 若无 `$V/.gitignore`,运行 `bash "<SKILL_ROOT>/scripts/init-default-vault.sh" "$V"` 或沿用其内置规则写入(见 SKILL §1.1);

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The file presents all user-facing instructions and quoted guidance exclusively in Chinese, which can amount to a language policy violation when no opt-in or alternative locale is offered. The document does not state that the skill is intended only for Chinese-speaking users or a China-specific environment.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

This shell script contains user-facing natural-language comments embedded in the generated .gitignore content exclusively in Chinese. Under the language/locale policy, forcing a specific language without user choice or documented justification can be a policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script defaults OBSIDIAN_CRON_TZ to Asia/Shanghai, which imposes a region-specific locale setting when the user does not explicitly choose one. This is a natural-language/policy concern because the skill behavior is tied to a specific locale by default rather than offering a neutral default or requiring opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script emits a user-facing error string only in Chinese: "无法解析 vault...". This is a natural-language locale choice embedded in code with no opt-in, fallback, or documentation indicating the skill is intentionally limited to Chinese-speaking users.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.