Summary
Capgo contains an authorization flaw in the device creation endpoint that trusts a caller-supplied organization identifier without verifying it against the target application.
Under these conditions, authenticated attackers can create device records for applications belonging to other organizations, bypassing the intended org-to-app authorization boundary.
Affected context
This vulnerability arises in Capgo deployments where the /private/create_device POST endpoint is exposed to authenticated users and relies on client-supplied org_id values to associate new device records.
The issue appears when the service does not enforce a server-side check that the provided org_id matches the organization that owns the target application, allowing logical cross-tenant operations in otherwise segmented environments.
Exploit preconditions
- Attack surface: HTTP API endpoint
POST /private/create_device - Required access: Valid authenticated account capable of calling private API methods
- Trigger point: Submission of a device creation request with a manipulated
org_idtargeting a foreign organization's application - Why exploitation is possible: The backend trusts the caller-supplied
org_idparameter and fails to re-derive or verify organizational ownership from server-side state, allowing cross-organization association of device records.
Why this happens
The underlying bug is an authorization design flaw where trust is placed in client-controlled identifiers instead of consistently enforcing access decisions based on server-side ownership checks.
In terms of CWE-285: Improper Authorization, the system does not confirm that a user creating a device for a given application is acting within the correct organization context, and fails to validate that the submitted org_id is authorized to operate on that application.
Abstractly, this reflects a pattern where multi-tenant boundaries are enforced only by request parameters, rather than by deriving tenant context from authenticated identity and backend relationships.
Potential impact
- Attackers may create device records under applications belonging to other organizations.
- Device inventory and telemetry data association across tenants could be corrupted.
- Organizations could see unauthorized devices linked to their apps, impacting monitoring, billing, or analytics.
- Further logic issues may arise if downstream workflows (e.g., provisioning, messaging, or updates) rely on accurate org-to-device associations.
General mitigation guidance
Effective mitigation typically focuses on enforcing server-side authorization checks based on trusted identity and application ownership rather than request parameters.
Useful patterns include:
- Deriving organization context from the authenticated user or application record, and ignoring or strictly validating client-supplied
org_idvalues. - Implementing centralized authorization logic that enforces tenant boundaries for every cross-entity operation (user → org → app → device).
- Applying defense-in-depth with policy checks that ensure the organization associated with an application cannot be overridden via request data.
- Designing APIs so that sensitive relationships (like org-to-app) are implicit and not directly controllable by clients.
How teams detect issues like this
Detection commonly relies on a mix of design review and automated checks:
- Code review emphasizing multi-tenant boundary enforcement and flagging any use of client-supplied identifiers in authorization decisions.
- Static analysis or linters that highlight patterns where
org_id-like parameters are trusted without cross-checking server-side ownership or principal context. - Logging and monitoring for anomalous patterns, such as devices frequently created for apps where the caller's primary org differs from the app's owning org.
- Periodic authorization audits that simulate cross-tenant operations to validate that policy enforcement is consistent across endpoints.

