fix(exec): harden approval auth and account routing#57650
Conversation
🔒 Aisle Security Analysis✅ We scanned this PR and did not find any security vulnerabilities. Aisle supplements but does not replace security review. Analyzed PR: #57650 at commit Last updated on: 2026-03-30T15:55:42Z |
Greptile SummaryThis PR hardens the approval authentication and routing layer across several dimensions: it closes an authorization bypass in the Key changes:
Confidence Score: 5/5Safe to merge — changes are well-scoped security hardening with comprehensive test coverage and no identified P0/P1 issues. All changed logic is covered by new unit tests, the security fixes are straightforward and correctly implemented, and no P0/P1 defects were found during review. No files require special attention.
|
| Filename | Overview |
|---|---|
| src/infra/channel-approval-auth.ts | Adds explicit field to ApprovalCommandAuthorization; returns explicit: false when no channel plugin resolves the authorization, explicit: true when one explicitly does. |
| src/auto-reply/reply/commands-approve.ts | Fixes the core bypass: the /approve gate now requires explicit && authorized instead of just authorized, so the implicit default no longer lets non-isAuthorizedSender callers through. |
| src/infra/exec-approval-channel-runtime.ts | Hardens the shared runtime: adds payload schema validation, caps pending approvals at 1000 with a 30-minute TTL, and replaces silent void promise patterns with a spawn helper that logs errors. |
| extensions/telegram/src/exec-approval-resolver.ts | Gates the plugin.approval.resolve fallback behind an explicit allowPluginFallback flag; a 'not found' error now propagates rather than silently retrying via the plugin endpoint. |
| extensions/telegram/src/bot-handlers.runtime.ts | Pre-evaluates both approver checks, passes allowPluginFallback: pluginApprovalAuthorizedSender to the resolver, and replaces raw error strings with a sanitized user-facing message. |
| extensions/telegram/src/approval-native.ts | Splits origin resolution into two functions, adds telegramTargetsMatch cross-validation, and propagates accountId to enable per-account scoping. |
| extensions/discord/src/approval-native.ts | Tightens Discord origin-target resolution: validates accountId consistency between turn source, session target, and the requesting account, and rejects channel-ID mismatches. |
| extensions/telegram/src/exec-approvals-handler.ts | Adds resolveBoundTelegramAccountId and uses it in matchesFilters to prevent cross-account plugin approval delivery. |
Reviews (1): Last reviewed commit: "test(exec): drop unused commands import" | Re-trigger Greptile
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7eb063e70e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
7eb063e to
147f6b5
Compare
fca29c6 to
7f725bb
Compare
147f6b5 to
e1b6fe6
Compare
7f725bb to
20111ae
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e1b6fe62f7
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
e1b6fe6 to
9b048c6
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9b048c63f7
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
9b048c6 to
5fda7a3
Compare
20111ae to
9e1426b
Compare
💡 Codex Review
ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
Superseded by the reviewable split here:
Closing this stacked PR so the approval work only has two active review surfaces: one main approval/runtime/routing/auth PR and one shell |
Summary
/approvebypasses normal sender authIssues
Related: #57460
Testing