Skip to content

fix(security): cross-org authorization bypass in server.remove#4874

Merged
Siumauricio merged 1 commit into
canaryfrom
fix/idor-server-remove
Jul 20, 2026
Merged

fix(security): cross-org authorization bypass in server.remove#4874
Siumauricio merged 1 commit into
canaryfrom
fix/idor-server-remove

Conversation

@Siumauricio

Copy link
Copy Markdown
Contributor

Fixes GHSA-3rpx-c3j9-q99x.

Problem

server.remove deleted the server record and its deployment rows using the caller-supplied serverId with no check that the server belongs to ctx.session.activeOrganizationId — unlike the sibling server.one and server.update, which do compare. The org check was dropped in 8127dc453 during the migration to withPermission("server", "delete"), which only enforces the role within the caller's own org, not ownership of input.serverId.

An owner/admin of org A (self-obtainable on open registration) could delete org B's server registration and deployment history by passing org B's serverId. haveActiveServices also ran before any ownership check, leaking existence/state of cross-org servers.

Fix

Resolve the server and compare organizationId against the active org before the active-services guard, matching the update handler. Cross-org callers now get UNAUTHORIZED with no existence leak. (redactServerSshKey was already applied to the response.)

Verification (localhost, two orgs)

  • Owner of org A removing an org B serverId401 UNAUTHORIZED, target server row intact.
  • Owner removing a server in their own org → 200 OK (unchanged).

Closes GHSA-3rpx-c3j9-q99x.

server.remove deleted a server (and its deployment rows) by caller-supplied
serverId without checking it belongs to the active organization, unlike server.one
and server.update. An owner/admin of org A could delete org B's server registration.
Resolve and compare the server's organizationId before the active-services guard,
so cross-org callers are rejected without leaking existence.
@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. bug Something isn't working labels Jul 20, 2026
@Siumauricio
Siumauricio merged commit b2ade17 into canary Jul 20, 2026
4 checks passed
@Siumauricio
Siumauricio deleted the fix/idor-server-remove branch July 20, 2026 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant