CVE-2026-30944: Studiocms StudioCMS Has Privilege Escalation Vulnerability

HIGH
Advisory Identifier: GHSA-667w-mmh7-mrr4
CVSS 8.8
CWE-639 CWE-863
Published
Advisory Summary

CVE-2026-30944 is a HIGH (CVSS 8.8) studiocms has privilege escalation vulnerability (CWE-639: Authorization Bypass Through User-Controlled Key) affecting Studiocms libraries in the npm ecosystem. The issue involves studiocms has privilege escalation via insecure api token generation. Remediation is available by upgrading affected packages to version 0.4.0.

CVE-2026-30944 at a Glance

CVE Identifier CVE-2026-30944
GHSA Identifier GHSA-667w-mmh7-mrr4
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-639: Authorization Bypass Through User-Controlled Key
Affected Product Studiocms
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 8.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-30944

To remediate this vulnerability, upgrade all affected Studiocms dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

studiocms fixed: 0.4.0
npm install studiocms@0.4.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls studiocms

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-30944, inspect your project dependencies using npm:

npm ls studiocms

Analyze the terminal output to locate any version of Studiocms in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.4.0), your application is affected.

Note: The npm ls studiocms command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-639: Authorization Bypass Through User-Controlled Key, where the system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data. In Studiocms, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## 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 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: 1. **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. 2. **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. 3. **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.

CVE-2026-30944 Affected Studiocms Versions

1 component(s)
Fixed Versions:
0.4.0
Product / Package Ecosystem Affected Versions Fixed Version
studiocms
npm
< 0.4.0
0.4.0

References

Frequently Asked Questions

What is CVE-2026-30944?
CVE-2026-30944 is a security vulnerability in Studiocms involving StudioCMS has Privilege Escalation via Insecure API Token Generation under CWE-639: Authorization Bypass Through User-Controlled Key.
Which Studiocms versions are affected?
Affected versions include releases prior to 0.4.0 across affected packages: studiocms.
What version fixes CVE-2026-30944?
Upgrading to 0.4.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is studiocms affected?
Yes, studiocms is affected in releases prior to 0.4.0. Upgrade your dependency to 0.4.0 or later.
What is the CVSS score of CVE-2026-30944?
CVE-2026-30944 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2026-30944?
CVE-2026-30944 is classified under CWE-639: Authorization Bypass Through User-Controlled Key (The system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data.).
How can I check npm dependencies for CVE-2026-30944?
Run the dependency tree command: 'npm ls studiocms'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-667w-mmh7-mrr4",
  "modified" : "2026-03-10T18:45:47Z",
  "published" : "2026-03-10T18:16:41Z",
  "aliases" : [ "CVE-2026-30944" ],
  "summary" : "StudioCMS has Privilege Escalation via Insecure API Token Generation",
  "details" : "## Summary\nThe /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.\n\n## Details\nThe 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.\nThis 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?\"\n\n#### Vulnerable Code\nThe following is the server-side handler for the POST /studiocms_api/dashboard/api-tokens endpoint:\n**File:** packages/studiocms/frontend/pages/studiocms_api/dashboard/api-tokens.ts (lines 16–57)\n**Version:** studiocms@0.3.0\n```\nPOST: (ctx) =>\n    genLogger('studiocms/routes/api/dashboard/api-tokens.POST')(function* () {\n        const sdk = yield* SDKCore;\n\n        // Check if demo mode is enabled\n        if (developerConfig.demoMode !== false) {\n            return apiResponseLogger(403, 'Demo mode is enabled, this action is not allowed.');\n        }\n\n        // Get user data\n        const userData = ctx.locals.StudioCMS.security?.userSessionData;       // [1]\n\n        // Check if user is logged in\n        if (!userData?.isLoggedIn) {                                            // [2]\n            return apiResponseLogger(403, 'Unauthorized');\n        }\n\n        // Check if user has permission\n        const isAuthorized = ctx.locals.StudioCMS.security?.userPermissionLevel.isEditor;  // [3]\n        if (!isAuthorized) {\n            return apiResponseLogger(403, 'Unauthorized');\n        }\n\n        // Get Json Data\n        const jsonData = yield* readAPIContextJson<{\n            description: string;\n            user: string;                                                       // [4]\n        }>(ctx);\n\n        // Validate form data\n        if (!jsonData.description) {\n            return apiResponseLogger(400, 'Invalid form data, description is required');\n        }\n\n        if (!jsonData.user) {\n            return apiResponseLogger(400, 'Invalid form data, user is required');\n        }\n\n        // [5] jsonData.user passed directly — no check against userData\n        const newToken = yield* sdk.REST_API.tokens.new(jsonData.user, jsonData.description);\n\n        return createJsonResponse({ token: newToken.key });                     // [6]\n    }),\n```\n**Analysis**\nThe authorization logic has three distinct flaws:\n1. **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. \n2. **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.\n3. **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).\n\n## PoC\n**Environment**\nThe following user roles were identified in the application:\n*User ID | Role*\n2450bf33-0135-4142-80be-9854f9a5e9f1 | owner\neacee42e-ae7e-4e9e-945b-68e26696ece4 | admin\n2d93a386-e9cb-451e-a811-d8a34bfdf4da | admin\n39b3e7d3-5eb0-48e1-abdc-ce95a57b212c | editor\na1585423-9ade-426e-a713-9c81ed035463 | visitor\n\n**Step 1 — Generate an API Token for the Owner (as Editor)**\nAn authenticated Editor sends the following request, specifying the owner user ID in the body:\n```\nPOST /studiocms_api/dashboard/api-tokens HTTP/1.1\nHost: <target>\nCookie: auth_session=<editor_session_cookie>\nContent-Type: application/json\nContent-Length: 74\n\n{\n  \"user\": \"2450bf33-0135-4142-80be-9854f9a5e9f1\",\n  \"description\": \"pwn\"\n}\n```\n**Result:** The server returns a valid JWT token bound to the owner account.\n\n**Step 2 — Use the Token to Access the API as Owner**\n```\ncurl -H \"Authorization: Bearer <owner_jwt_token>\" http://<target>/studiocms_api/rest/v1/users\n```\n**Result:** The attacker now has full API access with owner privileges, including the ability to list all users, modify content, and manage the application.\n\n## Impact\n- **Privilege Escalation:** Any authenticated user (above visitor) can escalate to owner level access.\n- **Full API Access:** The generated token grants unrestricted access to all REST API endpoints with the impersonated user's permissions.\n- **Account Takeover:** An attacker can impersonate any user in the system by specifying their UUID.\n- **Data Breach:** Access to user listings, content management, and potentially sensitive configuration data.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "studiocms"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.4.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.3.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/withstudiocms/studiocms/security/advisories/GHSA-667w-mmh7-mrr4"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-30944"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/withstudiocms/studiocms/commit/9eec9c3b45523b635cfe16d55aa55afabacbebe3"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/withstudiocms/studiocms/commit/f4a209fc090c90195e2419fff47b48a46eab7441"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/withstudiocms/studiocms"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/withstudiocms/studiocms/releases/tag/studiocms%400.4.0"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/withstudiocms/studiocms/releases/tag/studiocms@0.4.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-639", "CWE-863" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-10T18:16:41Z",
    "nvd_published_at" : "2026-03-10T18:18:54Z"
  }
}