{"id":"CVE-2026-25496","aliases":["CVE-2026-25496","GHSA-9f5h-mmq6-2x78"],"related":[],"kind":"vulnerability","state":"published","title":"Craft has a stored XSS in Number Prefix & Suffix Fields","summary":"Craft is a platform for creating digital experiences. In Craft versions 4.0.0-RC1 through 4.16.17 and 5.0.0-RC1 through 5.8.21, a stored XSS vulnerability exists in the Number field type settings. The Prefix and Suffix fields are rendered using the |md|raw Twig filter without proper escaping, allowing script execution when the Number field is displayed on users' profiles. This issue is patched in versions 4.16.18 and 5.8.22.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Craft is a platform for creating digital experiences. In Craft versions 4.0.0-RC1 through 4.16.17 and 5.0.0-RC1 through 5.8.21, a stored XSS vulnerability exists in the Number field type settings. The Prefix and Suffix fields are rendered using the |md|raw Twig filter without proper escaping, allowing script execution when the Number field is displayed on users' profiles. This issue is patched in versions 4.16.18 and 5.8.22.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nA stored XSS vulnerability exists in the Number field type settings. The Prefix and Suffix fields are rendered using the `|md|raw` Twig filter without proper escaping, allowing script execution when the Number field is displayed on users' profiles.\n\n## Proof of Concept\n\n### Required Permissions\n\n- Administrator access\n- `allowAdminChanges` is enabled in production, which is against our [security recommendations](https://craftcms.com/knowledge-base/securing-craft).\n\n### Steps to Reproduce\n1. Log in with an admin account\n2. Navigate to **Settings** → **Fields** → **New field**\n3. Choose **Number** as the field type\n4. Set the **Prefix/Suffix Text** field to: <img width=\"611\" height=\"908\" alt=\"image\" src=\"https://github.com/user-attachments/assets/63766ca4-4fa9-490b-8bea-37364137527d\" />\n```html\n<img src=x onerror=\"alert('Number Prefix/Suffix XSS')\" hidden>\n```\n5. Save the field\n6. Add this field to any element (e.g., User Profile fields via **Settings** → **Users** → **User Fields**)\n7. Navigate to your account (`/admin/myaccount`) or any user profile (`/admin/users/{id}`)\n8. XSS executes when viewing the form <img width=\"1246\" height=\"677\" alt=\"image-1\" src=\"https://github.com/user-attachments/assets/dafeb2b7-905f-4a4b-b3d6-1c16a905498f\" />\n\n## Mitigation\nSanitize prefix/suffix before rendering or use `|e` filter instead of `|raw`.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Craft es una plataforma para crear experiencias digitales. En las versiones de Craft 4.0.0-RC1 hasta 4.16.17 y 5.0.0-RC1 hasta 5.8.21, existe una vulnerabilidad de XSS almacenado en la configuración del tipo de campo Número. Los campos Prefijo y Sufijo se renderizan utilizando el filtro Twig |md|raw sin el escape adecuado, lo que permite la ejecución de scripts cuando el campo Número se muestra en los perfiles de los usuarios. Este problema está parcheado en las versiones 4.16.18 y 5.8.22.","source":"nvd"}],"published":"2026-02-09T19:45:19.835Z","modified":"2026-06-17T10:24:44.367Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:P/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N","score":4.8,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:P/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N","score":4.8,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:P/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:L/I:L/A:N","score":4.8,"rating":"MEDIUM"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"version":">= 5.0.0-RC1, < 5.8.22","status":"affected"},{"version":">= 4.0.0-RC1, < 4.16.18","status":"affected"}],"vendor":"craftcms","product":"cms","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"5.0.0-RC1","status":"affected","fixed":"5.8.22"}],"ecosystem":"Packagist","package":"craftcms/cms","purl":"pkg:composer/craftcms/cms","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"4.0.0-RC1","status":"affected","fixed":"4.16.18"}],"ecosystem":"Packagist","package":"craftcms/cms","purl":"pkg:composer/craftcms/cms","source":"ghsa"},{"ranges":[{"status":"affected","introduced":">4.0.0","fixed":"4.16.18"},{"status":"affected","introduced":">5.0.0","fixed":"5.8.22"},{"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-9f5h-mmq6-2x78","tags":["exploit","patch","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/craftcms/cms/commit/cb5fb0e979e72f315c9178fc031883d49527f513","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/craftcms/cms/releases/tag/5.8.22","tags":["release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-25496","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/craftcms/cms","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/craftcms/cms/releases/tag/4.16.18","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-02-10T15:30:19.770Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-25496","url":"https://www.cve.org/CVERecord?id=CVE-2026-25496","licence":"CVE Terms of Use","modified":"2026-02-10T16:00:13.566Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-9f5h-mmq6-2x78","url":"https://github.com/advisories/GHSA-9f5h-mmq6-2x78","licence":"CC-BY-4.0","modified":"2026-02-22T23:23:27.171Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-25496","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-25496","licence":"Public domain","modified":"2026-06-17T10:24:44.367Z"}],"updatedAt":"2026-11-25T22:59:13.669Z","epss":{"score":0.0041,"percentile":0.37323,"date":"2026-12-01T12:00:22.000Z"}}