Repository navigation
fix(compute): reject canceling another resource's deployment - #13104
Merged
Merged
Conversation
Functions and Sites status-update (cancel) endpoints fetched a deployment by ID without verifying it belonged to the function/site in the URL path. A caller with write access on one resource could cancel a build belonging to another. Match Get/Delete/Download by rejecting with DEPLOYMENT_NOT_FOUND when resourceId does not match. Supersedes the stale #11868 approach with a rebased fix. Co-authored-by: Chirag Aggarwal <[email protected]>
Add e2e regressions that attempt to cancel a deployment through a function/site that does not own it and expect deployment_not_found. Co-authored-by: Chirag Aggarwal <[email protected]>
Contributor
Greptile SummaryThe PR completes deployment ownership validation for the Functions and Sites cancellation endpoints.
Confidence Score: 5/5The PR appears safe to merge. The previously reported cross-resource-type cancellation path is closed because both endpoints now validate the deployment's resource type as well as its resource ID, and no blocking failure remains. Important Files Changed
Reviews (2): Last reviewed commit: "fix(compute): also require matching depl..." | Re-trigger Greptile |
Function and site IDs are independent namespaces, so a resourceId-only guard can still cancel a cross-type deployment when IDs collide. Reject when resourceType is not functions/sites for the respective endpoint. Co-authored-by: Chirag Aggarwal <[email protected]>
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
ChiragAgg5k
approved these changes
Aug 5, 2026
This was referenced Aug 6, 2026
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.
What does this PR do?
Adds missing deployment ownership checks to Functions and Sites status-update (cancel) endpoints:
PATCH /v1/functions/:functionId/deployments/:deploymentId/statusPATCH /v1/sites/:siteId/deployments/:deploymentId/statusThese endpoints previously only checked
isEmpty(), so a caller with write access on one function/site could cancel a build belonging to another resource. Sibling Get/Delete/Download endpoints already reject this withDEPLOYMENT_NOT_FOUNDwhenresourceIddoes not match.Test Plan
FunctionsCustomServerTest::testCancelDeploymentRequiresOwnershipSitesCustomServerTest::testCancelDeploymentRequiresOwnershipRelated PRs and Issues
mainwith tests)Checklist