Summary
StudioCMS exposed an API token deletion endpoint that allowed any authenticated editor-level user to revoke API tokens for any other account, including admins and owners.
Because the endpoint trusted tokenID and userID from the request without verifying ownership or role hierarchy, attackers could disrupt critical integrations and automations by deleting others' tokens.
Affected context
This vulnerability occurs in StudioCMS deployments that:
- Expose the
DELETE /studiocms_api/dashboard/api-tokensendpoint to authenticated users with editor or higher roles - Use API tokens to power external integrations, automations, or programmatic access
- Rely on the backend to enforce token ownership and role-based restrictions
The risk is elevated in environments where non-admin users routinely manage content but should not affect other users' API tokens.
Exploit preconditions
- Attack surface: HTTP API endpoint at
DELETE /studiocms_api/dashboard/api-tokens - Required access: Any authenticated account with editor privileges or above
- Trigger point: Sending a crafted DELETE request that includes the
tokenID(and optionallyuserID) of a token owned by another user - Why exploitation is possible: The handler accepts
tokenIDanduserIDdirectly from the request payload and performs deletion without: - Verifying that the caller owns the token
- Ensuring the caller's role is sufficiently privileged relative to the target user
- Enforcing object-level access control on API tokens
Why this happens
The core issue maps to CWE-639: Insecure Direct Object Reference combined with CWE-863: Incorrect Authorization.
The API endpoint directly uses client-supplied identifiers (tokenID, userID) as references to sensitive objects (API tokens), assuming that any authenticated editor-level caller is allowed to operate on those objects.
Because the server does not perform ownership checks or robust authorization decisions tied to the authenticated identity and role hierarchy, users can manipulate identifiers in requests to affect resources they do not control.
This pattern exemplifies broken access control: trusting user-provided identifiers to select security-sensitive resources without enforcing object-level permissions.
Potential impact
- Deletion of API tokens belonging to admin and owner accounts
- Targeted denial of service against critical integrations relying on those tokens
- Disruption of scheduled automations and background jobs
- Operational downtime for dependent services or workflows
- Erosion of auditability when tokens are removed without proper authorization trails
General mitigation guidance
Effective mitigation focuses on enforcing strict object-level authorization and minimizing trust in client-supplied identifiers:
- Bind API token operations to the authenticated user context on the server side, deriving the acting user from the session or token rather than request payload fields.
- Enforce ownership checks so that a user can only delete tokens they own, unless explicitly granted higher administrative privileges.
- Implement role-aware access control rules that prevent lower-privileged roles (e.g., editor) from modifying resources owned by higher-privileged roles (e.g., admin, owner).
- Avoid accepting raw
userIDin mutation endpoints when the identity can be inferred from authentication; treat any cross-user operations as an explicit, restricted administrative capability. - Centralize authorization logic in reusable helpers or middleware so that all resource operations consistently apply the same access control rules.
How teams detect issues like this
Detecting this class of vulnerability typically involves both code-focused and behavior-focused approaches:
- Code review patterns:
- Look for endpoints that accept object identifiers (e.g.,
tokenID,userID) from client input and perform create/update/delete operations without ownership or role checks. - Flag controller or handler functions where authorization is performed only at the route level (role-based) but not at the object level (resource ownership).
- Static analysis:
- Use rules or custom queries to identify handlers that:
- Use user-controlled IDs to query or mutate sensitive tables (tokens, users, permissions) and
- Lack calls to centralized authorization or policy-check functions.
- Runtime monitoring:
- Log and analyze API calls that delete tokens, correlating the authenticated user ID with the target
userID/tokenIDto highlight cross-account deletions. - Configure anomaly detection to alert on unusual patterns, such as an editor account deleting multiple tokens for other users.
- Policy enforcement:
- Introduce an authorization layer or policy engine (e.g., RBAC/ABAC middleware) that explicitly enforces ownership and role hierarchy for resource actions.

