/

CVE-2026-30944

Severity:

HIGH RISK

(8.8)

Improper Authorization / Insecure Direct Object Reference

CVE-2026-30944

Analyzed

Vulnerability type

Category:

Improper Authorization / Insecure Direct Object Reference

CWE:

CWE-639, CWE-863

Impact:

Privilege Escalation via Unauthorized Token Creation

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

StudioCMS contains an authorization flaw where any authenticated user with at least Editor role can generate API tokens for arbitrary user accounts, including owners and administrators.

By abusing the /studiocms_api/dashboard/api-tokens endpoint, an attacker can escalate privileges and operate with higher-level permissions than intended.

Affected context

This vulnerability occurs in StudioCMS deployments that expose the dashboard API for managing user API tokens.

Specifically, the /studiocms_api/dashboard/api-tokens endpoint accepts a target user identifier from the request and issues a token bound to that user, but does not properly verify that the requesting user is authorized to act on that target account.

Any environment where Editor-level accounts exist and can access this endpoint is potentially affected, even if administrative actions are intended to be restricted.

Exploit preconditions

  • Attack surface: Application dashboard API endpoint (/studiocms_api/dashboard/api-tokens)
  • Required access: Valid StudioCMS account with at least Editor role and access to the dashboard API
  • Trigger point: Submitting a token creation request for another user's ID (e.g., owner/admin) through the API
  • Why exploitation is possible: The endpoint relies on user-supplied identifiers without enforcing a proper authorization check that binds the operation to the caller's own account or role, enabling Insecure Direct Object Reference (CWE-639) and Missing Authorization (CWE-863).

Why this happens

The core issue is a missing, or insufficient, authorization check when handling token creation requests.

The API accepts a target user ID from the client and uses it directly to create an API token for that user, without confirming that the caller is permitted to manage tokens for that account.

This pattern maps to CWE-639: Insecure Direct Object Reference, where internal identifiers (user IDs) are exposed and trusted, and CWE-863: Missing Authorization, where the system authenticates the caller but fails to verify that they are authorized for the requested action.

The bug reflects a common design flaw where resource ownership or administrative boundaries are not enforced at the controller or service layer, allowing lower-privileged users to perform actions reserved for higher-privileged accounts.

Potential impact

  • An Editor-level user could generate API tokens for owner or admin accounts.
  • Attackers may obtain effective admin-level API access without knowing admin credentials.
  • Compromise of content management functions, including creation, modification, or deletion of content.
  • Potential reconfiguration of site settings, user management, or plugin integration actions exposed via the API.
  • Lateral movement within the application by impersonating other privileged accounts.

General mitigation guidance

Effective mitigation focuses on robust, centralized authorization and strict binding between callers and the resources they operate on:

  • Enforce ownership checks: limit token creation to the caller's own account unless the caller holds an explicit administrative role with delegated management rights.
  • Implement role- and permission-based access control on all token management endpoints, ensuring only designated roles can create or manage tokens for others.
  • Avoid trusting client-supplied user identifiers; derive the effective user context from the authenticated session or token wherever feasible.
  • Introduce a consistent authorization layer or middleware that validates both who is calling and which resource they are allowed to affect.
  • Apply the principle of least privilege to API tokens, constraining scopes and limiting the blast radius of any single token.
  • Consider logging and alerting for sensitive actions such as cross-account token creation attempts, even when authorized.

How teams detect issues like this

Detection strategies generally focus on authorization gaps and abnormal token usage patterns:

  • Static analysis and code review:
  • Flag controller or route handlers where user or resource IDs are taken directly from request parameters and used to perform sensitive actions without explicit authorization checks.
  • Look for token-related endpoints that do not verify ownership or role-based permissions before acting on a target user.
  • Use a consistent security annotation or middleware pattern and identify endpoints that bypass or omit it.
  • Automated security testing:
  • Integrate authorization test cases into API test suites, attempting to perform privileged operations (e.g., token creation for other users) from lower-privileged accounts.
  • Utilize dynamic application security testing focused on IDOR and authorization flaws around user and token management APIs.
  • Logging and monitoring:
  • Record all token creation events with caller identity, target user ID, and source IP.
  • Establish anomaly detection rules for cross-account token creation, particularly when initiated by non-admin roles.

Sources

SourceLink
github.comgithub.com/withstudiocms/studiocms/commit/f4a209fc090c90195e2419fff47b48a46eab7441
github.comgithub.com/withstudiocms/studiocms/releases/tag/studiocms@0.4.0
github.comgithub.com/withstudiocms/studiocms/security/advisories/GHSA-667w-mmh7-mrr4

Frequently asked

questions

Yes. Any remote attacker who can obtain a valid StudioCMS account with at least Editor privileges and reach the dashboard API endpoint could exploit this issue, without needing direct server access.

The attacker must be an authenticated user with the minimum role that can access the /studiocms_api/dashboard/api-tokens endpoint (described as Editor or above). From there, they can generate tokens for higher-privileged accounts.

Implement strict authorization checks on the token generation endpoint so that:

  • Non-admin users can only create tokens for themselves, ignoring any client-supplied user ID.
  • Administrative roles explicitly validate that they are allowed to manage tokens for other users.

Centralizing authorization logic and enforcing consistent patterns across all sensitive endpoints is key.

Adopt a defense-in-depth approach to access control:

  • Design APIs so that sensitive operations do not rely on client-supplied identifiers for determining the acting user.
  • Use standardized authorization middleware or decorators for all privileged operations.
  • Incorporate access control tests into CI pipelines, including scenarios where lower-privileged users attempt cross-account operations.
  • Regularly perform security reviews specifically focused on broken access control and IDOR patterns in user and token management flows.
Find out what's already
exploitable in your codebase.