{"id":"CVE-2026-28696","aliases":["CVE-2026-28696","GHSA-7x43-mpfg-r9wj"],"related":[],"kind":"vulnerability","state":"published","title":"Craft affected by IDOR via GraphQL @parseRefs","summary":"Craft is a content management system (CMS). Prior to 4.17.0-beta.1 and 5.9.0-beta.1, the GraphQL directive @parseRefs, intended to parse internal reference tags (e.g., {user:1:email}), can be abused by both authenticated users and unauthenticated guests (if a Public Schema is enabled) to access sensitive attributes of any element in the CMS. The implementation in Elements::parseRefs fails to perform authorization checks, allowing attackers to read data they are not authorized to view. This vulnerability is fixed in 4.17.0-beta.1 and 5.9.0-beta.1.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Craft is a content management system (CMS). Prior to 4.17.0-beta.1 and 5.9.0-beta.1, the GraphQL directive @parseRefs, intended to parse internal reference tags (e.g., {user:1:email}), can be abused by both authenticated users and unauthenticated guests (if a Public Schema is enabled) to access sensitive attributes of any element in the CMS. The implementation in Elements::parseRefs fails to perform authorization checks, allowing attackers to read data they are not authorized to view. This vulnerability is fixed in 4.17.0-beta.1 and 5.9.0-beta.1.","source":"cvelist"},{"lang":"en","text":"The GraphQL directive `@parseRefs`, intended to parse internal reference tags (e.g., `{user:1:email}`), can be abused by both authenticated users and unauthenticated guests (if a Public Schema is enabled) to access sensitive attributes of any element in the CMS. The implementation in `Elements::parseRefs` fails to perform authorization checks, allowing attackers to read data they are not authorized to view.\n\n## Vulnerability Details\n\n`craft\\services\\Elements::parseRefs` identifies reference tags and resolves them using `_getRefTokenReplacement`. This method fetches the referenced element and accesses the specified attribute via $element->$attribute.\n\n- Missing Auth Check: It bypasses `canView()` checks.\n- Polymorphic Access: `getElementTypeByRefHandle` allows referencing any element type (entry, asset, user, category).\n- Custom Field Access: Since Craft elements use `__get()` to resolve custom field handles, an attacker is not limited to core attributes. They can exfiltrate any custom field data by enumerating the field handle (e.g. `{entry:123:privateNotes}`).\n\n## Attack Vectors\n\n1. Privilege Escalation / User Data Leak\n\nAn attacker can enumerate sensitive attributes of administrators or other users.\n\n- Payload: `{user:1:email}` or `{user:1:photoId}`\n\n2. Arbitrary Property Reflection & Server-Side Logic Execution\n\nThe vulnerability allows reflecting any accessible property of the underlying Element model.\n\n- Username/Admin Enumeration: `{user:1:username}` (Confirmed: returns admin), {user:1:admin}.\n- Internal Path Disclosure: Accessing methods that trigger errors (e.g., `{user:1:authKey}`) exposes full server stack traces in the GraphQL error response (e.g., Exception: No user session token exists with paths like `/var/www/html/...`).\n\n3. IDOR on Private Entries & Assets (Polymorphism)\n\nThe vulnerability is not limited to Users. Reference tags can target any element type.\n\n- Payload: `{entry:456:myConfidentialField}` (Bypasses canView checks).\n- Asset Path Leakage: `{volume:1:path}` can expose internal file system paths.\n\n4. Unauthenticated Exploitation (Public Schema)\n\nConfirmed locally. The `@parseRefs` directive is active in the Public Schema. By injecting a payload into a public-facing field (e.g., a \"News\" entry title), an unauthenticated guest can trigger the resolution and retrieve the sensitive output.\n\n## Steps to Reproduce\n\n1. Setup (Admin Panel):\n- Create a Section (e.g., \"News\") and an Entry Type.\n- Create a new Entry in that section. Set the Title to the payload: {user:1:username} or {user:1:email}.\n- Go to GraphQL > Schemas > Public Schema. Enable it, and ensure \"Query for elements in the Site\" and \"News\" section queries are checked.\n\n2. Execute Exploit (Unauthenticated):\n- Send a POST request to http://localhost:8000/index.php?action=graphql/api:\n```\ncurl -X POST \\\n-H \"Content-Type: application/json\" \\\n-d '{\"query\": \"{ entries { title @parseRefs } }\"}'\n```\n\n3. Observation:\n- The API returns `{\"data\":{\"entries\":[{\"title\":\"admin\"}]}}` (or the email).\n- Using `{user:1:authKey}` triggers an internal server error that leaks the full server path in string format.\n\n## Impact\n\n- Critical Information Disclosure: Full PII enumeration (emails, usernames).\n- System Information Leakage: Absolute server paths via stack traces.\n- Authentication Bypass: Guest accounts can effectively query the database as the system user.\n\n## Recommended Fix\n\nModify `Elements::parseRefs` to enforce `canView` permissions on the resolved element before extracting attributes.\n\n## References\n\nhttps://github.com/craftcms/cms/commit/4d98a07e47580f1712095825d3e3c4d67bc9f8b9","format":"markdown","source":"ghsa"},{"lang":"es","text":"Craft es un sistema de gestión de contenido (CMS). Antes de 4.17.0-beta.1 y 5.9.0-beta.1, la directiva GraphQL @parseRefs, destinada a analizar etiquetas de referencia internas (p. ej., {user:1:email}), puede ser explotada tanto por usuarios autenticados como por invitados no autenticados (si un Esquema Público está habilitado) para acceder a atributos sensibles de cualquier elemento en el CMS. La implementación en Elements::parseRefs no realiza comprobaciones de autorización, permitiendo a los atacantes leer datos que no están autorizados a ver. Esta vulnerabilidad se corrige en 4.17.0-beta.1 y 5.9.0-beta.1.","source":"nvd"}],"published":"2026-03-03T20:38:55.000Z","modified":"2026-06-17T10:28:55.490Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N","score":8.7,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N","score":8.7,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N","rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","score":7.5,"rating":"HIGH"}],"cwes":["CWE-639","CWE-862"],"affected":[{"ranges":[{"version":">= 4.0.0-RC1, < 4.17.0-beta.1","status":"affected"},{"version":">= 5.0.0-RC1, < 5.9.0-beta.1","status":"affected"}],"vendor":"craftcms","product":"cms","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"4.0.0-RC1","status":"affected","fixed":"4.17.0-beta.1"}],"ecosystem":"Packagist","package":"craftcms/cms","purl":"pkg:composer/craftcms/cms","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"5.0.0-RC1","status":"affected","fixed":"5.9.0-beta.1"}],"ecosystem":"Packagist","package":"craftcms/cms","purl":"pkg:composer/craftcms/cms","source":"ghsa"},{"ranges":[{"status":"affected","introduced":">4.0.0","fixed":"4.17.0"},{"status":"affected","introduced":">5.0.0","fixed":"5.9.0"},{"status":"affected","version":"4.0.0"},{"status":"affected","version":"4.0.0"},{"status":"affected","version":"4.0.0"},{"status":"affected","version":"4.0.0"},{"status":"affected","version":"5.0.0"},{"status":"affected","version":"5.0.0"}],"vendor":"craftcms","product":"craft_cms","cpe":"cpe:2.3:a:craftcms:craft_cms:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/craftcms/cms/security/advisories/GHSA-7x43-mpfg-r9wj","tags":["exploit","mitigation","patch","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/craftcms/cms/commit/4d98a07e47580f1712095825d3e3c4d67bc9f8b9","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-28696","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/craftcms/cms","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2026-03-04T18:00:48.225Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-28696","url":"https://www.cve.org/CVERecord?id=CVE-2026-28696","licence":"CVE Terms of Use","modified":"2026-03-04T18:00:59.824Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-7x43-mpfg-r9wj","url":"https://github.com/advisories/GHSA-7x43-mpfg-r9wj","licence":"CC-BY-4.0","modified":"2026-03-04T18:48:33.368Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-28696","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-28696","licence":"Public domain","modified":"2026-06-17T10:28:55.490Z"}],"updatedAt":"2026-11-25T22:59:15.178Z","epss":{"score":0.00486,"percentile":0.43468,"date":"2026-12-01T12:00:22.000Z"}}