Summary
Dokploy's GitHub provider setup endpoint may accept unauthenticated requests while trusting organization and user identifiers supplied through a state value. An attacker could use this behavior to add a GitHub App provider containing sensitive credentials and private key material to another organization.
Affected context
The issue occurs in Dokploy deployments using the GitHub provider setup flow before authentication and authorization are sufficiently enforced. Risk is present when the setup endpoint is reachable without authentication and caller-controlled state data is used to select the target organization or user context.
Exploit preconditions
- Attack surface: The GitHub provider setup API route at
/api/providers/github/setup - Required access: Network access to the endpoint; a valid authenticated session is not necessarily required
- Trigger point: Processing of the
stateparameter and subsequent GitHub provider creation - Why exploitation is possible: Organization and user identifiers from
gh_initstate data are trusted without adequate authentication and authorization checks - Resulting condition: Provider records containing GitHub client secrets, webhook secrets, or PEM private key material may be inserted into an unintended organization
Why this happens
The vulnerability is caused by an authentication and authorization boundary failure. The setup handler trusts identity and organization context supplied by a client-controlled state value, then invokes provider creation without first establishing that the requester is authorized to act for the selected organization. This behavior maps to CWE-306: Missing Authentication for Critical Function, because a sensitive provider-management operation can be reached without a sufficient authentication check.
Potential impact
- An attacker may create unauthorized GitHub provider records in another organization
- Sensitive client secrets, webhook secrets, or private key material could be stored under an unintended tenant
- The affected organization could experience unauthorized GitHub App integrations
- Exposed or misassociated credentials could enable follow-on access, repository actions, or webhook abuse
- Administrators may face data exposure, service disruption, or incident-response costs
General mitigation guidance
Mitigation generally focuses on enforcing authentication and tenant-aware authorization before any provider creation or credential storage occurs.
Common defensive patterns include:
- Require an authenticated session for the complete GitHub setup flow
- Derive the organization and user context from trusted server-side identity rather than client-supplied identifiers
- Bind state values to the initiating user, intended organization, and a short-lived server-side transaction
- Apply explicit authorization checks before creating or updating provider records
- Validate that secrets and private keys are stored only within the authorized tenant boundary
- Use least-privilege service identities and minimize the permissions granted to stored GitHub App credentials
- Avoid logging sensitive provider material and provide rotation or revocation workflows
How teams detect issues like this
Detection approaches can include:
- Static analysis rules that flag unauthenticated API handlers performing credential, integration, or tenant-management operations
- Code review checks for organization or user identifiers taken directly from query parameters, request bodies, or state values
- Tests that verify unauthenticated requests cannot create or modify providers
- Authorization tests covering cross-tenant organization identifiers and state replay
- Runtime monitoring for provider creation events without a corresponding authenticated actor and approved organization context
- Policy enforcement requiring authentication and authorization middleware on sensitive API routes

