craftcms/cms · Security
Craft CMS Vulnerable to Stored XSS in Number Prefix & Suffix Fields
- GHSA ID
- GHSA-9f5h-mmq6-2x78
- CVE ID
- CVE-2026-25496
- Severity
- medium
- Published
- Updated
- CVSS v4
- 4.8 · 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
Description
Summary
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.
Proof of Concept
Required Permissions
- Administrator access
allowAdminChangesis enabled in production, which is against our security recommendations.
Steps to Reproduce
- Log in with an admin account
- Navigate to Settings → Fields → New field
- Choose Number as the field type
- Set the Prefix/Suffix Text field to:
<img src=x onerror="alert('Number Prefix/Suffix XSS')" hidden>
- Save the field
- Add this field to any element (e.g., User Profile fields via Settings → Users → User Fields)
- Navigate to your account (
/admin/myaccount) or any user profile (/admin/users/{id}) - XSS executes when viewing the form
Mitigation
Sanitize prefix/suffix before rendering or use |e filter instead of |raw.
CWEs
- CWE-79 · Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
References
- https://github.com/craftcms/cms/security/advisories/GHSA-9f5h-mmq6-2x78 ↗
- https://github.com/craftcms/cms/commit/cb5fb0e979e72f315c9178fc031883d49527f513 ↗
- https://github.com/craftcms/cms/releases/tag/4.16.18 ↗
- https://github.com/craftcms/cms/releases/tag/5.8.22 ↗
- https://nvd.nist.gov/vuln/detail/CVE-2026-25496 ↗
- https://github.com/advisories/GHSA-9f5h-mmq6-2x78 ↗