Skip to content

fix(security): re-apply lost v2026.3.1/v2026.3.2 security improvements#2254

Merged
alexey-pelykh merged 1 commit intomainfrom
fix/2201-reapply-security-improvements
Apr 10, 2026
Merged

fix(security): re-apply lost v2026.3.1/v2026.3.2 security improvements#2254
alexey-pelykh merged 1 commit intomainfrom
fix/2201-reapply-security-improvements

Conversation

@alexey-pelykh
Copy link
Copy Markdown

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-approves read calls only when the target path resolves within cwd, preventing unrestricted filesystem access. Adds web_search to safe auto-approve set. Excludes memory_search (gutted subsystem). New functions: extractPathFromToolTitle, resolveToolPathCandidate, resolveAbsoluteScopedPath, isPathWithinRoot, isReadToolCallScopedToCwd.

  • src/commands/doctor-config-flow.ts — Allowlist policy detection + repair (~260 LoC). detectEmptyAllowlistPolicy warns when an empty allowlist silently blocks all DMs/group messages. maybeRepairAllowlistPolicyAllowFrom auto-recovers sender entries from the pairing store. Wired into both --fix and read-only doctor flows.

  • src/config/defaults.ts — Replaces naive string-based API key check with hasConfiguredSecretInput() to properly handle secret references ($ENV_VAR, op://vault/item), preventing false negatives.

Not included (already present)

Test plan

  • TypeScript type-check passes (0 errors in src/)
  • oxlint passes (0 warnings, 0 errors)
  • oxfmt format check passes
  • 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
  • Full test suite: 12166 passed, 1 skipped (1 infra flake — worker fork crash, not related)
  • No new @ts-expect-error suppressions introduced

🤖 Generated with Claude Code

#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>
@alexey-pelykh alexey-pelykh enabled auto-merge (squash) April 10, 2026 22:24
@alexey-pelykh alexey-pelykh merged commit aa79a7f into main Apr 10, 2026
10 checks passed
@alexey-pelykh alexey-pelykh deleted the fix/2201-reapply-security-improvements branch April 10, 2026 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Re-apply lost v2026.3.1/v2026.3.2 security improvements (4 findings)

1 participant