fix(security): re-apply lost v2026.3.1/v2026.3.2 security improvements#2254
Merged
alexey-pelykh merged 1 commit intomainfrom Apr 10, 2026
Merged
Conversation
#2201) PR #2191 wholesale-restored 20 files from pre-v2026.3.1, discarding legitimate upstream security improvements. Re-apply 3 of 4 findings (finding #1 was already present): - acp/client.ts: scoped read-tool auto-approval — auto-approves `read` calls only when target path is within cwd, preventing unrestricted filesystem access. Adds `web_search` to safe auto-approve set. Excludes `memory_search` (gutted subsystem). - doctor-config-flow.ts: allowlist policy detection + repair — `detectEmptyAllowlistPolicy` warns when empty allowlists silently block all DMs/group messages. `maybeRepairAllowlistPolicyAllowFrom` auto-recovers from pairing store. - config/defaults.ts: replace naive string-based API key check with `hasConfiguredSecretInput()` to properly handle secret references (`$ENV_VAR`, `op://vault/item`). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
Re-applies 3 upstream security improvements that were silently discarded when PR #2191 wholesale-restored files from pre-v2026.3.1.
Closes #2201
Changes
src/acp/client.ts— Scoped read-tool auto-approval (~90 LoC). Auto-approvesreadcalls only when the target path resolves withincwd, preventing unrestricted filesystem access. Addsweb_searchto safe auto-approve set. Excludesmemory_search(gutted subsystem). New functions:extractPathFromToolTitle,resolveToolPathCandidate,resolveAbsoluteScopedPath,isPathWithinRoot,isReadToolCallScopedToCwd.src/commands/doctor-config-flow.ts— Allowlist policy detection + repair (~260 LoC).detectEmptyAllowlistPolicywarns when an empty allowlist silently blocks all DMs/group messages.maybeRepairAllowlistPolicyAllowFromauto-recovers sender entries from the pairing store. Wired into both--fixand read-only doctor flows.src/config/defaults.ts— Replaces naive string-based API key check withhasConfiguredSecretInput()to properly handle secret references ($ENV_VAR,op://vault/item), preventing false negatives.Not included (already present)
src/commands/agent.ts—agentCommandFromIngresswithsenderIsOwnerenforcement was already in the current codebase (not lost during fix: remediate v2026.3.1 and v2026.3.2 sync regressions #2191 restoration).Test plan
src/acp/client.test.ts— 31/31 tests pass (including scoped read auto-approval tests)src/commands/doctor-config-flow.test.ts— 17/17 tests pass@ts-expect-errorsuppressions introduced🤖 Generated with Claude Code