-
Notifications
You must be signed in to change notification settings - Fork 121
Open
Description
Hi team — I reviewed the hook automation paths in arscontexta and found several places where secure defaults could be improved.
Important context: this report is about hardening and trust boundaries. It does not claim malicious intent.
Summary
Current behavior is convenient for trusted single-user workflows, but risky in adversarial or mixed-trust environments.
Findings
- Broad auto-staging + commit-hook bypass
hooks/scripts/auto-commit.shusesgit add -Aand commits with--no-verify.- Risk: accidental staging of sensitive/unrelated files and bypass of local security hooks.
- Repo-local script execution from SessionStart
hooks/scripts/session-orient.shrunsbash ops/scripts/reconcile.sh --compactif present.- Risk: arbitrary repo-local execution surface at session start.
- Raw context injection into model context
session-orient.shemits raw file content (self/goals.md,self/identity.md, etc.) directly into the conversation context.- Risk: prompt-injection-style instruction smuggling via vault content.
- Fail-open vault detection / marker auto-creation
hooks/scripts/vaultguard.shauto-creates.arscontextabased on fallback checks.- Risk: hooks can activate in places where explicit opt-in was not intended.
Proposed hardening (minimal breakage)
- Add a
security_modeconfig with defaultstrict. - In strict mode, replace
git add -Awith an allowlisted set of paths. - In strict mode, disable
--no-verifyby default (allow explicit override). - Gate
reconcile.shexecution behind explicit opt-in (allow_reconcile_exec: falsedefault). - Treat loaded file content as untrusted data:
- wrap in clear delimiters,
- prepend non-instructional framing,
- cap size per file.
- Require explicit marker presence for activation (no fallback auto-create in strict mode).
- Document this threat model in
SECURITY.md(“trusted personal vault” vs “shared/untrusted repo”).
Why this helps
These changes preserve current UX for trusted workflows (compat mode) while giving security-conscious users a safer default profile.
If useful, I can open a PR with a backward-compatible strict/legacy toggle.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels