GHSA-9V82-XRM4-MP52
Vulnerability from github – Published: 2026-03-12 14:49 – Updated: 2026-03-12 14:49Summary
The updateUserNotifications endpoint accepts a user ID from the request payload and uses it to update that user's notification preferences. It checks that the caller is logged in but never verifies that the caller owns the target account (id !== userData.user.id). Any authenticated visitor can modify notification preferences for any user, including disabling admin notifications to suppress detection of malicious activity.
Details
The vulnerable handler is in packages/studiocms/frontend/pages/studiocms_api/_handlers/dashboard/users.ts:257-311:
.handle(
'updateUserNotifications',
Effect.fn(function* ({ payload: { id, notifications } }) {
// ...demo mode checks...
const [sdk, userData] = yield* Effect.all([SDKCore, CurrentUser]);
// Line 274: Only checks login + visitor level — any authenticated user passes
if (!userData.isLoggedIn || !userData.userPermissionLevel.isVisitor) {
return yield* new DashboardAPIError({ error: 'Unauthorized' });
}
// Line 280: Uses 'id' from payload — NOT userData.user.id
const existingUser = yield* sdk.GET.users.byId(id);
// Line 288: Updates target user using attacker-controlled 'id'
const updatedData = yield* sdk.AUTH.user.update({
userId: id, // ← attacker controls this
userData: {
id, // ← attacker controls this
name: existingUser.name,
username: existingUser.username,
updatedAt: new Date().toISOString(),
emailVerified: existingUser.emailVerified,
createdAt: undefined,
notifications, // ← attacker controls this
},
});
})
)
For comparison, the updateUserProfile handler in dashboard/profile.ts correctly uses userData.user.id instead of a user-supplied ID, preventing IDOR.
PoC
# 1. Log in as a visitor-role user, obtain session cookie
# 2. Disable all notifications for the admin user
curl -X POST 'http://localhost:4321/studiocms_api/dashboard/update-user-notifications' \
-H 'Cookie: studiocms-session=<visitor-session-token>' \
-H 'Content-Type: application/json' \
-d '{
"id": "<admin-user-id>",
"notifications": ""
}'
# Expected: 403 Forbidden
# Actual: 200 {"message":"User notifications updated successfully"}
Impact
- Any authenticated visitor can disable notification preferences for admin/owner accounts, suppressing alerts about new user creation, account changes, and user deletions
- Enables attack chaining — suppress admin notifications first, then perform other malicious actions with reduced detection risk
- Can modify any user's notification preferences (enable unwanted notifications or disable critical ones)
Recommended Fix
Add an ownership check in packages/studiocms/frontend/pages/studiocms_api/_handlers/dashboard/users.ts:
// After the login check at line 274, add:
if (id !== userData.user?.id && !userData.userPermissionLevel.isAdmin) {
return yield* new DashboardAPIError({
error: 'Unauthorized: cannot modify another user\'s notification preferences',
});
}
{
"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-32104"
],
"database_specific": {
"cwe_ids": [
"CWE-639"
],
"github_reviewed": true,
"github_reviewed_at": "2026-03-12T14:49:41Z",
"nvd_published_at": "2026-03-11T21:16:16Z",
"severity": "MODERATE"
},
"details": "## Summary\n\nThe `updateUserNotifications` endpoint accepts a user ID from the request payload and uses it to update that user\u0027s notification preferences. It checks that the caller is logged in but never verifies that the caller owns the target account (`id !== userData.user.id`). Any authenticated visitor can modify notification preferences for any user, including disabling admin notifications to suppress detection of malicious activity.\n\n## Details\n\nThe vulnerable handler is in `packages/studiocms/frontend/pages/studiocms_api/_handlers/dashboard/users.ts:257-311`:\n\n```typescript\n.handle(\n \u0027updateUserNotifications\u0027,\n Effect.fn(function* ({ payload: { id, notifications } }) {\n // ...demo mode checks...\n\n const [sdk, userData] = yield* Effect.all([SDKCore, CurrentUser]);\n\n // Line 274: Only checks login + visitor level \u2014 any authenticated user passes\n if (!userData.isLoggedIn || !userData.userPermissionLevel.isVisitor) {\n return yield* new DashboardAPIError({ error: \u0027Unauthorized\u0027 });\n }\n\n // Line 280: Uses \u0027id\u0027 from payload \u2014 NOT userData.user.id\n const existingUser = yield* sdk.GET.users.byId(id);\n\n // Line 288: Updates target user using attacker-controlled \u0027id\u0027\n const updatedData = yield* sdk.AUTH.user.update({\n userId: id, // \u2190 attacker controls this\n userData: {\n id, // \u2190 attacker controls this\n name: existingUser.name,\n username: existingUser.username,\n updatedAt: new Date().toISOString(),\n emailVerified: existingUser.emailVerified,\n createdAt: undefined,\n notifications, // \u2190 attacker controls this\n },\n });\n })\n)\n```\n\nFor comparison, the `updateUserProfile` handler in `dashboard/profile.ts` correctly uses `userData.user.id` instead of a user-supplied ID, preventing IDOR.\n\n## PoC\n\n```bash\n# 1. Log in as a visitor-role user, obtain session cookie\n\n# 2. Disable all notifications for the admin user\ncurl -X POST \u0027http://localhost:4321/studiocms_api/dashboard/update-user-notifications\u0027 \\\n -H \u0027Cookie: studiocms-session=\u003cvisitor-session-token\u003e\u0027 \\\n -H \u0027Content-Type: application/json\u0027 \\\n -d \u0027{\n \"id\": \"\u003cadmin-user-id\u003e\",\n \"notifications\": \"\"\n }\u0027\n\n# Expected: 403 Forbidden\n# Actual: 200 {\"message\":\"User notifications updated successfully\"}\n```\n\n## Impact\n\n- Any authenticated visitor can disable notification preferences for admin/owner accounts, suppressing alerts about new user creation, account changes, and user deletions\n- Enables attack chaining \u2014 suppress admin notifications first, then perform other malicious actions with reduced detection risk\n- Can modify any user\u0027s notification preferences (enable unwanted notifications or disable critical ones)\n\n## Recommended Fix\n\nAdd an ownership check in `packages/studiocms/frontend/pages/studiocms_api/_handlers/dashboard/users.ts`:\n\n```typescript\n// After the login check at line 274, add:\nif (id !== userData.user?.id \u0026\u0026 !userData.userPermissionLevel.isAdmin) {\n return yield* new DashboardAPIError({\n error: \u0027Unauthorized: cannot modify another user\\\u0027s notification preferences\u0027,\n });\n}\n```",
"id": "GHSA-9v82-xrm4-mp52",
"modified": "2026-03-12T14:49:41Z",
"published": "2026-03-12T14:49:41Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/withstudiocms/studiocms/security/advisories/GHSA-9v82-xrm4-mp52"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-32104"
},
{
"type": "PACKAGE",
"url": "https://github.com/withstudiocms/studiocms"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:L",
"type": "CVSS_V3"
}
],
"summary": "StudioCMS: IDOR in User Notification Preferences Allows Any Authenticated User to Modify Any User\u0027s Settings"
}
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.