CVE-2026-56393: Craft CMS Stored XSS in Admin Configuration Fields (4.x, 5.x)
Craft CMS administrators can inject malicious JavaScript code into configuration fields—such as section names, volume names, or checkbox labels—that will execute when other administrators view those settings in the control panel. This happens because Craft renders these fields without removing potentially harmful code. An attacker with admin privileges and the ability to modify admin settings could weaponize this to steal session tokens or perform unauthorized actions on behalf of other users.
Source data · NVD / CISA · public domain
- CVSS
- 3.1 · 4.8 MEDIUM · CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:L/I:L/A:N
- Weaknesses (CWE)
- CWE-79
- Affected products
- 0 configuration(s)
- Published / Modified
- 2026-06-21 / 2026-06-22
NVD description (verbatim)
Craft CMS 4.x (>= 4.0.0-RC1, < 4.17.0-beta.1) and 5.x (>= 5.0.0-RC1, < 5.9.0-beta.1) contain multiple stored cross-site scripting vulnerabilities where settings names and field option labels are rendered without sanitization (e.g., via the checkbox.twig template, which used {{ label|raw }}). An authenticated administrator (with allowAdminChanges enabled) can inject malicious payloads into section names, volume names, user group names, global set names, generated field names, checkbox/radio option labels, and custom source labels, causing arbitrary JavaScript to execute in other users' control-panel sessions. Fixed in 4.17.0-beta.1 and 5.9.0-beta.1.
5 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
Craft CMS versions 4.x before 4.17.0-beta.1 and 5.x before 5.9.0-beta.1 contain multiple stored XSS vulnerabilities (CWE-79) across several administrative configuration surfaces. The root cause is the use of the `|raw` filter in Twig templates (e.g., checkbox.twig rendering `{{ label|raw }}`) without prior HTML sanitization. An authenticated administrator with allowAdminChanges enabled can inject arbitrary JavaScript into section names, volume names, user group names, global set names, generated field names, checkbox/radio option labels, and custom source labels. The payload is stored in the database and executed in the browsers of any administrator viewing the affected settings, regardless of whether they have permission to modify them. The attack vector is network-based, requires high privilege (admin role), and depends on user interaction (target admin must view the infected setting), yielding a CVSS score of 4.8 (Medium).
Business impact
For organizations running Craft CMS as a headless CMS or website platform, a malicious admin can compromise the sessions and credentials of other admins without additional attacks. This enables lateral privilege escalation, deletion of content, unauthorized API access, or defacement. The risk is elevated in multi-tenant or agency environments where admins from different teams access the same instance. In compliance-sensitive sectors, stored XSS in admin panels can violate data protection obligations if it leads to unauthorized data access or modification.
Affected systems
Craft CMS 4.x versions from 4.0.0-RC1 up to and including 4.16.x are vulnerable. Craft CMS 5.x versions from 5.0.0-RC1 up to and including 5.8.x are vulnerable. Craft CMS 4.17.0-beta.1 and Craft CMS 5.9.0-beta.1 and later versions are patched. Users running 4.17.0 GA (when released) and 5.9.0 GA will be protected. Earlier stable and RC releases require immediate patching.
Exploitability
Exploitation requires valid admin credentials with allowAdminChanges permission enabled—a relatively high barrier. However, once an admin is compromised or turns malicious, weaponization is trivial: they simply type a payload into any configuration field. No special tooling, unusual network access, or user social engineering is required. The stored nature of the XSS means the attack is repeatable and affects all subsequent visitors to the infected setting. The UI/R component (user interaction) is low friction in a control panel context, as admins routinely inspect settings.
Remediation
Upgrade Craft CMS 4.x instances to 4.17.0-beta.1 or later (verify against the Craft CMS release page for GA availability); upgrade Craft CMS 5.x instances to 5.9.0-beta.1 or later. If immediate upgrades are not feasible, restrict the allowAdminChanges permission to a minimal, trusted subset of admins and conduct an audit of configuration fields for suspicious payloads. After patching, admins should review recent changes to section/volume/group/field names and labels for evidence of injection.
Patch guidance
Craft CMS provides patched versions at 4.17.0-beta.1 for the 4.x branch and 5.9.0-beta.1 for the 5.x branch. Users should download directly from the official Craft CMS website or upgrade via Composer. Beta versions are considered release candidates; verify that your deployment process and tests cover these versions. Once GA versions are released, plan a migration to those stable releases. Test patches thoroughly in a staging environment before deploying to production, particularly to validate that custom Twig templates or plugins do not rely on the |raw filter in untrusted contexts.
Detection guidance
Search your Craft database for suspicious patterns in configuration tables (sections, volumes, user groups, global sets, fields, and custom sources). Look for JavaScript patterns such as <script>, onerror=, onload=, onclick=, or other event handlers in field names and labels. Implement database integrity monitoring on tables that store admin-modifiable configuration. Monitor control-panel access logs for unusual read patterns (an attacker may probe for successful injection points). Consider deploying a WAF or XSS-filtering reverse proxy in front of the Craft control panel, though this is not a substitute for patching. Review admin audit logs for unauthorized configuration changes.
Why prioritize this
Although the CVSS score is 4.8 (Medium), the vulnerability warrants prompt patching because (1) it affects the administrative control panel directly, (2) it enables session hijacking and privilege escalation, (3) stored XSS can persist across multiple sessions and is difficult to clean up without inspection, and (4) it requires only admin credentials, not zero-day exploitation. Prioritize this higher than the CVSS alone suggests if your organization has multi-admin teams or shared hosting environments.
Risk score, explained
CVSS 3.1 score of 4.8 reflects Network attack vector, Low complexity, High privilege requirement, and Required user interaction. Confidentiality and Integrity impact are both Low (an attacker can view other admins' data and modify content in their context, but cannot directly delete data or escalate to system-level compromise). Availability is None. The High privilege barrier (admin role) and Required user interaction (target admin must view the setting) suppress the score despite the stored nature of the XSS. In practice, the risk may be higher in organizations with compromised or malicious admins; adjust your risk appetite accordingly.
Frequently asked questions
Can a non-admin user exploit this vulnerability?
No. The vulnerability requires authentication as an administrator with the allowAdminChanges permission enabled. Site visitors and editors without admin privileges cannot inject payloads.
What if we only trust our admin team—is this really a risk?
Yes. Insiders (disgruntled staff, compromised accounts) are a common threat. Additionally, in agencies or SaaS platforms, admins from different organizations may share the same Craft instance, making malicious injection by one tenant a significant risk to others.
Do we need to patch if we have an admin with allowAdminChanges set to false?
Yes. The vulnerability is still present in the code; you are relying on configuration to defend against it. A configuration mistake, privilege creep, or future permission changes could expose you. Patching is the proper mitigation.
How long does it take to upgrade Craft CMS?
Upgrade time depends on your environment, custom plugins, and deployment process. In most cases, backing up your database, running `composer update craftcms/cms` to the patched version, and running migrations takes 15–60 minutes. Always test in staging first.
This analysis is based on published CVE data and vendor advisories. Readers should verify patch availability and compatibility with their specific Craft CMS version, plugins, and deployment configuration before implementing any remediation. SEC.co does not provide warranty or indemnity for patch outcomes. Organizations are responsible for testing patches in staging environments and validating functionality before production deployment. For official guidance, consult the Craft CMS security documentation and release notes. Source: NVD (public-domain), retrieved 2026-07-29. Analysis generated by SEC.co (claude-haiku-4-5).
Weaknesses (CWE)
Related vulnerabilities
- CVE-2016-20070MEDIUMPrivilege Escalation & Stored XSS in WordPress Booking Calendar Contact Form 1.0.23
- CVE-2018-25384MEDIUMStored XSS in Wikidforum 2.20 Allows Authenticated Attackers to Inject Malicious Scripts
- CVE-2019-25731MEDIUMStored XSS in Zuz Music 2.1 Contact Form
- CVE-2019-25737MEDIUMStored XSS in Live Chat Unlimited 2.8.3 – Admin Session Compromise
- CVE-2019-25739MEDIUMGigToDo 1.3 Stored XSS Vulnerability in Proposal Descriptions
- CVE-2019-25742MEDIUMStored XSS in Zoner Real Estate WordPress Theme 4.1.1 – Admin Account Compromise Risk
- CVE-2019-25743MEDIUMWordPress Soliloquy Lite 2.5.6 Stored XSS Vulnerability
- CVE-2019-25744MEDIUMWordPress Popup Builder 3.49 Stored XSS Vulnerability – Exploit Prevention & Patch Guide