fix(commands): close requires_auth() fail-open gap in 19 CommandHandler impls#6033
Merged
Merged
Conversation
…er impls CommandHandler::requires_auth() defaults to false, so any handler that omits an explicit override runs even from untrusted remote channels (Telegram/Discord/Slack). This is the third confirmed instance of the defect class, after /image (#5967) and /mcp+/plugins (#5997). Audited all 50 CommandHandler impls in crates/zeph-commands/src/handlers/ and added requires_auth() -> true to the 19 that mutate local filesystem, process, or config state, or disclose sensitive configuration: UndoCommand, RedoCommand, PlanCommand, SkillCommand, KnowledgeSlashCommand, AgentCommand, AgentsFleetCommand, ConvCommand, MemoryCommand, GraphCommand, GoalCommand, AcpCommand, CompactCommand, FeedbackCommand, CocoonCommand, NewConversationCommand, ClearCommand, ResetCommand, ClearQueueCommand. RecapCommand, SkillsCommand, GuidelinesCommand, ExitCommand, QuitCommand, and HelpCommand were audited and confirmed safe as read-only or already self-gated, and left unchanged. The trait's fail-open default is unchanged; flipping it to fail-closed is deferred as a separate architectural decision. Closes #6003
bug-ops
enabled auto-merge (squash)
July 11, 2026 14:03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CommandHandler::requires_auth()fail-open-by-default defect class, after/image(SECURITY: /image command allows unauthenticated remote users (Telegram/Discord/Slack) to read arbitrary files under the server's working directory #5967/fix(commands): require trusted session for /image path reads #5988) and/mcp+/plugins(SECURITY: /mcp add allows unauthenticated remote code execution via missing requires_auth (default-config exploitable); /plugins add has the same gap #5997/fix(commands): require trusted session for /mcp and /plugins #6002).impl CommandHandlerblocks incrates/zeph-commands/src/handlers/and addedrequires_auth() -> trueto the 19 that mutate local filesystem/process/config state, spawn processes, or disclose sensitive configuration:UndoCommand,RedoCommand,PlanCommand,SkillCommand,KnowledgeSlashCommand,AgentCommand,AgentsFleetCommand,ConvCommand,MemoryCommand,GraphCommand,GoalCommand,AcpCommand,CompactCommand,FeedbackCommand,CocoonCommand,NewConversationCommand,ClearCommand,ResetCommand,ClearQueueCommand.RecapCommand,SkillsCommand,GuidelinesCommand,ExitCommand,QuitCommand,HelpCommandaudited and confirmed safe (read-only or self-gated viasupports_exit()); left unchanged.Test plan
cargo nextest run --config-file .github/nextest.toml -p zeph-commands --all-features— 177/177 passed, including one dispatch-level allowed/rejected test pair per gated handler (or direct unit assert foracp.rs/cocoon.rs, matching each file's existing test convention).cargo +nightly fmt --check— clean.cargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warnings— clean.RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --all-features -p zeph-commandsandcargo test --doc -p zeph-commands --all-features— clean.--features cocoon). Verdict: approved, no blocking findings..local/testing/coverage-status.md.