StudioCMS has Privilege Escalation via Insecure API Token Generation
Date: 2026-03
Affected: npm/studiocms
Attack vector: auth-bypass
Category: vulnerability-disclosure
Severity: High
CVE: CVE-2026-30944
CWE: CWE-639
CWE-863
CVSS: 8.8 (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H)

## Summary The /studiocms_api/dashboard/api-tokens endpoint allows any authenticated user (at least Editor) to generate API tokens for any other user, including owner and admin accounts. The endpoint fails to validate whether the requesting user is authorized to create tokens on behalf of the target user ID, resulting in a full privilege escalation. ## Details The API token generation endpoint accepts a user parameter in the request body that specifies which user the token should be created for. The server-side logic authenticates the session (via auth_session cookie) but does not verify that the authenticated user matches the target user ID nor checks if the caller has sufficient privileges to perform this action on behalf of another user. This is a classic BOLA vulnerability: the authorization check is limited to "is the user logged in?" instead of "is this user authorized to perform this action on this specific resource?" #### Vulnerable Code The following is the server-side handler for the POST /studiocms_api/dashboard/api-tokens endpoint: **File:** packages/studiocms/frontend/pages/studiocms_api/dashboard/api-tokens.ts (lines 16–57) **Version:** studiocms@0.3.0 ``` POST: (ctx) => genLogger('studiocms/routes/api/dashboard/api-tokens.POST')(function* () { const sdk = yield* SDKCore; // Check if demo mode is enabled if (developerConfig.demoMode !== false) { return apiResponseLogger(403, 'Demo mode is enabled, this action is not all


Mitigations:

Architectural layers (MAESTRO):