Fix orchestration plan approval bypass and openRepo binding leak#364
Closed
cursor[bot] wants to merge 2 commits into
Closed
Fix orchestration plan approval bypass and openRepo binding leak#364cursor[bot] wants to merge 2 commits into
cursor[bot] wants to merge 2 commits into
Conversation
Deny lead patches to approval-gated paths (whole leadState, planning phase completion, planApprovedAt). isOrchestrationPlanApproved now requires planApprovedAt while still in planning phase instead of treating planning phase done as sufficient. Also guard claimTask when the run manifest is missing. Regression tests in patchPolicy and orchestrationTools. Co-authored-by: Arul Sharma <arul28@users.noreply.github.com>
openRepo nulls the runtime binding before invoking IPC. A cancelled dialog returned null without restoring the previous binding, so later calls routed to the wrong runtime until another refresh. Mirror switchToPath by stashing and restoring previousBinding on null or error. Co-authored-by: Arul Sharma <arul28@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
This was referenced May 26, 2026
Owner
|
Closing in favor of #382. I validated the orchestration approval/binding issues here and folded the real fixes into the combined orchestration hardening lane. |
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.
Bug and impact
Orchestration plan approval bypass (security)
The lead agent could spawn full-auto worker/validator sessions without user approval by patching
manifest.jsondirectly: replacing/leadStatewithplanApprovedAt, or marking/phases/{id:planning}/statusasdone.isOrchestrationPlanApprovedtreated planning phasedoneas sufficient even withoutplanApprovedAt.openRepo cancel leaves preload binding null (routing)
project.openRepoclearedcurrentProjectBindingbefore IPC but did not restore it when the user cancelled the dialog (nullresult). Subsequent calls could route to the wrong runtime (main vs remote daemon) until another binding refresh.claimTask crash on missing manifest
claimTaskusedruntime.manifest!without a guard when the bundle was missing, causing an unhandledTypeErroron IPC.Root cause
LEAD_DENY_PATTERNSblocked only leaf approval paths, not whole-object/leadStatereplace or planning-phase completion paths.isOrchestrationPlanApprovedhad a shortcut viaphases[].status === "done".openRepolacked thepreviousBindingrestore pattern already used byswitchToPath.Fix
planApprovedAtwhilecurrentPhase === "planning".previousBindingonopenReponull/error.run not foundfromclaimTaskwhen manifest is absent.Validation
npx vitest run src/main/services/orchestration/patchPolicy.test.tsnpx vitest run src/main/services/ai/tools/orchestrationTools.test.ts -t "spawnAgent|self-approve|planning phase"npx vitest run src/preload/preload.test.ts -t "restores the previous binding when openRepo"Note: PR #363 (CRR alter leak + failed remote switch binding) is separate and not duplicated here.