fix: a project's config can't place worktrees anywhere, or leak into your own config

Merged
KI
19d ago
+841-156

Problem

A security review found that a repository's .vigent.toml reaches further than it should, in both builds:

  • [worktree] dir checks the repo out anywhere. .. and absolute paths are allowed and created with mkdir -p. dir = "../../.config/nvim/plugin" put the repo's files where nvim loads them (confirmed).
  • Saving :settings copies project values into your config.toml: theme, engine, leader, [ui], [style], worktree.enabled/backend.
  • A trusted project's Claude Code allow and args become global when "always allow" or :permissions rewrites your config.
  • Project templates silently replace built-ins. For example, [templates.review] replaces the built-in review, which promises to change nothing.

Change

Details follow as the commits land.

Status

Draft. In progress; the full checks run before this leaves draft.

Verification

To be filled in: tests in both languages for each item, plus the full pty suite through the binary.

Follow-ups

None yet.


Generated by Claude Code


Summary by cubic

Restricts what a project's .vigent.toml can change outside the repository and keeps its values from leaking into your own config.

  • A project's [worktree] dir must stay inside the repository's parent folder with no dot-folders; any dir is refused in your home folder or a dot-folder outside the repo, symlinks resolved.
  • :settings saves only what you changed, and :permissions plus "always allow" save only your own args and allow rules.
  • An untrusted project's ask = true waits for :trust, since it offers "always allow", which writes to your config.
  • A project template named like a built-in or yours becomes project-<name> and shows as the project's in :templates.