colibri/crates
Sam & Claude 8c7051f046
Some checks failed
CI / rust (pull_request) Has been cancelled
CI / markdown (pull_request) Has been cancelled
CI / port (pull_request) Has been cancelled
CI / agent-jail-pkgs (pull_request) Has been cancelled
fix(vault): canonicalize + allowed-root containment on provision target (#92)
PR #91 added a string-equality registered-vs-spawned root check, which doesn't
catch `..`, symlinks, or a root pointing outside the jails tree. Add a real
containment guard in colibri-vault::provision, the layer that writes the .env:

- Before create_dir_all, canonicalize the target (resolving `..`/symlinks) and
  assert it is STRICTLY under the allowed jail-root base; refuse otherwise.
  Running before create_dir_all means a traversal/symlink target can't even
  create a directory outside the tree, let alone an .env.
- Allowed base defaults to /usr/local/bastille/jails (FreeBSD/Bastille),
  overridable via COLIBRI_JAIL_ROOT_BASE for Linux/Docker volume roots.
- Fail-closed: returns VaultError::TargetEscapesRoot; the daemon spawn hook
  already treats provision errors as fail-soft (no .env written).
- Tests: child accepted; base-itself / nonexistent / `..`-escape / symlink-escape
  all refused (no tempfile dep — uses std temp_dir).

Acceptance (#92): a target with `..`, a symlink, or resolving outside the jail
root is refused, no .env written. fmt + clippy --all-targets clean;
cargo test --workspace 230 passed / 0 failed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-20 22:58:30 +02:00
..
clawdie release: colibri 0.11.0 + relicense AGPL-3.0 -> MIT 2026-06-20 22:05:47 +02:00
colibri-client release: colibri 0.11.0 + relicense AGPL-3.0 -> MIT 2026-06-20 22:05:47 +02:00
colibri-contracts release: colibri 0.11.0 + relicense AGPL-3.0 -> MIT 2026-06-20 22:05:47 +02:00
colibri-daemon release: colibri 0.11.0 + relicense AGPL-3.0 -> MIT 2026-06-20 22:05:47 +02:00
colibri-deepseek release: colibri 0.11.0 + relicense AGPL-3.0 -> MIT 2026-06-20 22:05:47 +02:00
colibri-glasspane release: colibri 0.11.0 + relicense AGPL-3.0 -> MIT 2026-06-20 22:05:47 +02:00
colibri-glasspane-tui release: colibri 0.11.0 + relicense AGPL-3.0 -> MIT 2026-06-20 22:05:47 +02:00
colibri-mcp release: colibri 0.11.0 + relicense AGPL-3.0 -> MIT 2026-06-20 22:05:47 +02:00
colibri-runtime release: colibri 0.11.0 + relicense AGPL-3.0 -> MIT 2026-06-20 22:05:47 +02:00
colibri-skills release: colibri 0.11.0 + relicense AGPL-3.0 -> MIT 2026-06-20 22:05:47 +02:00
colibri-store release: colibri 0.11.0 + relicense AGPL-3.0 -> MIT 2026-06-20 22:05:47 +02:00
colibri-vault fix(vault): canonicalize + allowed-root containment on provision target (#92) 2026-06-20 22:58:30 +02:00