You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
harden(PATH): trusted-PATH resolution for wrapped binaries (defer trojan-on-PATH defense) #40
Codex P1 on PR for issue #39: secure_command_with_policy calls resolved_command(policy.name) which uses which::which() against the inherited PATH. A tainted parent PATH (PATH=/tmp/evil:$PATH) can swap in trojan git/rg/etc. before any env stripping fires.
Defense options (pick one in the eventual PR)
(a) Resolve against a hardcoded trusted-PATH list: /usr/bin, /bin, /usr/local/bin, /opt/homebrew/bin, ~/.cargo/bin. Anything else gets a warning.
(b) Make trusted-PATH a config option in ~/.config/contextcrawler/config.toml with sane defaults.
(c) Use which::which_in() against a sanitized PATH that omits world-writable dirs.
Threat model note
The user's zero-trust framing: "ONLY the LLM/Claude is making the calls; they shouldn't do vile things". A tainted PATH typically requires earlier compromise (someone wrote to PATH-listed dir). Lower probability than env-var hijack but still worth a follow-up.
Out of scope
The current PR for #39 leaves PATH resolution unchanged (matches all existing call sites via resolved_command). This issue tracks the discrete hardening pass.
Activity
review: serialize env-mutating policy_registry test + file thehoff#40 …
thehoff commentedon Jun 10, 2026
Closing — marked defer; trusted-PATH resolution not on the near-term roadmap.