Skip to content

Invitation Role Escalation Allows Organization Takeover

High
Siumauricio published GHSA-fm9p-wmpw-gxjh Jul 21, 2026

Package

npm dokploy (npm)

Affected versions

<0.29.4

Patched versions

None

Description

Summary

Any user with member:create permission (including all admin-role members by default) can create an invitation with role: "owner", granting the invited account full owner privileges upon acceptance. The server does not validate that the inviter's role is sufficient to delegate the target role. Once the invitation is accepted, the new owner cannot be demoted, resulting in a permanent organization takeover.

Details

The organization.inviteMember tRPC procedure (apps/dokploy/server/api/routers/organization.ts:250-353) is gated by withPermission("member", "create"), which controls the ability to invite but does not restrict the role value in the request body. The input schema accepts any of owner, admin, or member (or a valid custom role string), and the invitation row is persisted with the attacker-chosen role at line 321.

When the invitee accepts via authClient.organization.acceptInvitation, better-auth's organization plugin reads the stored invitation.role and inserts a member row with that role. The updateMemberRole handler (line 431) explicitly prevents any changes to or from the owner role, meaning the legitimate owner cannot demote the attacker-created owner.

A related issue exists in user.createUserWithCredentials (packages/server/src/services/user.ts:399-484), which allows an admin/owner on self-hosted instances to create a user with an arbitrary role string (including owner) without going through the invitation flow or requiring email verification.

PoC

Prerequisites: A Dokploy instance with an admin-level account (or any custom role with member:create permission).

Step 1 — Create owner-level invitation from an admin session:

POST /api/trpc/organization.inviteMember?batch=1 HTTP/1.1
Host: <target>
Content-Type: application/json
Cookie: better-auth.session_token=<ADMIN_SESSION>

{"0":{"json":{"email":"[email protected]","role":"owner"}}}

Response (HTTP 200):

{
  "result": {
    "data": {
      "json": {
        "id": "<invitation_id>",
        "organizationId": "<org_id>",
        "email": "[email protected]",
        "role": "owner",
        "status": "pending",
        "expiresAt": "2026-05-14T14:17:01.612Z"
      }
    }
  }
}

Step 2 — Register and accept the invitation:

Navigate to /invitation?token=<invitation_id>, register an account with the matching email, and accept the invitation. The attacker is now an owner member of the organization.

Step 3 — Verify permanence:

The legitimate owner cannot demote the attacker via updateMemberRole — the handler rejects any role change involving owner.

Impact

Any admin-level user (or any user granted member:create via a custom role) can escalate to full organization owner. This grants unrestricted access to all organization resources, the ability to remove other members (including the original owner's admin access), and control over organization settings and deletion. The escalation is permanent and cannot be reversed through the application's role management interface.

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H

CVE ID

CVE-2026-45790

Weaknesses

Improper Privilege Management

The product does not properly assign, modify, track, or check privileges for an actor, creating an unintended sphere of control for that actor. Learn more on MITRE.

Credits