Skip to content

Craft CMS Vulnerable to Stored XSS in Settings Names and Field Options

Low severity GitHub Reviewed Published Mar 2, 2026 in craftcms/cms • Updated Mar 3, 2026

Package

composer craftcms/cms (Composer)

Affected versions

>= 5.0.0-RC1, < 5.9.0-beta.1
>= 4.0.0-RC1, < 4.17.0-beta.1

Patched versions

5.9.0-beta.1
4.17.0-beta.1

Description

Overview of all XSS Reports

Multiple stored XSS vulnerabilities were found in Craft CMS. They were split into 4 reports as follows:

Report What's Vulnerable Why Separate
This Report (1) Multiple settings names Twig Template: _includes/forms/checkbox.twig
Report 2 Entry Types Name Twig Template: _includes/forms/editableTable.twig
Report 3 Card Attributes in Field Layout helpers/Cp.php
Report 4 (Commerce) Product Type Name Source in Commerce, sink in CMS - will report this one via Commerce GHSA

Reports 2, 3, and 4 are clearly distinct locations. For this report (Report 1), it was not clear whether to split or consolidate these 7 bugs. The bug report was consolidated and the final categorization should be left to the judgement of the user.

Note: This overview is only in this Report. Other reports only reference this one.


Summary

Stored XSS in multiple settings. Names/labels are rendered without sanitization via checkbox.twig template which uses {{ label|raw }}.


Affected Sources

# Source (injection point) Sink (where payload reflects)
1 Section Name (/admin/settings/sections) Entries field -> Sources checklist
2 Volume Name (/admin/settings/assets/volumes/{vol_id}) Assets field -> Sources checklist
3 User Group Name (/admin/settings/users/groups) Users field -> Sources, User permissions page
4 Global Set Name (/admin/settings/globals) User permissions page
5 Generated Fields Name (Volumes, Users, etc.) Card Attributes checkboxes
6 Checkboxes & Radio Buttons Field Option Label (/admin/settings/fields) User profile pages
7 Custom Sources Label (/admin/users -> Customize Sources) Users field -> Sources checklist

Proof of Concept

Required Permissions (Attacker)

Bugs 1-3: Section, Volume, User Group Names

  1. Log in as admin.
  2. Inject payload in one of these:
    • Settings -> Sections -> Create/edit section -> Name
    • Settings -> Assets -> Volumes -> Create/edit volume -> Name
    • Settings -> Users -> User Groups -> Create/edit group -> Name
  3. Set Name to:
<img src=x onerror="alert('XSS')">
  1. Save.
  2. Go to Settings -> Fields -> Create new field.
  3. To trigger the XSS payload: Set Field Type to "Entries" (for Sections), "Assets" (for Volumes), or "Users" (for User Groups). The alert fires when the Sources checkbox list renders.

Note: User Group Name also reflects on User permissions page under User Groups section (/admin/users/{id}/permissions).


Bug 4: Global Set Name

  1. Go to Settings -> Globals (/admin/settings/globals).
  2. Create/edit a Global Set, set Name to payload.
  3. Save.
  4. Go to Users -> Edit any user -> Permissions tab (/admin/users/{id}/permissions).
  5. Alert fires because our payload got rendered in the "Global Sets" permissions section without encoding/sanitization.

Bug 5: Generated Fields Name

  1. Go to Settings -> Assets -> Volumes -> Create/Edit a volume.
  2. Scroll to Generated Fields section.
  3. Add a field, set Name to payload:
<img src=x onerror="alert('XSS')">
  1. Save & Notice the alert. The payload renders in the Card Attributes checkbox list below it.

Bug 6: Checkboxes/Radio Buttons Option Label

  1. Go to Settings -> Fields (/admin/settings/fields).
  2. Create new field, set Field Type to "Checkboxes" or "Radio Buttons".
  3. In Field Options, add an option with Label set to payload.
  4. Save the field.
  5. Go to Settings -> Users -> User Profile Fields (/admin/settings/users/fields).
  6. Add the created field to the layout and save.
  7. Alert fires on any user profile page (/admin/users/{id}).

Bug 7: Custom Sources Label

  1. Go to Users (/admin/users).
  2. Click the three dots icon -> Customize Sources.
  3. Create a new custom source, set Label to payload.
  4. Save.
  5. Go to Settings -> Fields -> Create new field.
  6. Set Field Type to "Users".
  7. Alert fires in the Sources checkbox list.

Resources

craftcms/cms@943152d
craftcms/cms@67780a7

References

@angrybrad angrybrad published to craftcms/cms Mar 2, 2026
Published to the GitHub Advisory Database Mar 3, 2026
Reviewed Mar 3, 2026
Last updated Mar 3, 2026

Severity

Low

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v4 base metrics

Exploitability Metrics
Attack Vector Network
Attack Complexity Low
Attack Requirements None
Privileges Required None
User interaction Passive
Vulnerable System Impact Metrics
Confidentiality None
Integrity None
Availability None
Subsequent System Impact Metrics
Confidentiality Low
Integrity Low
Availability None

CVSS v4 base metrics

Exploitability Metrics
Attack Vector: This metric reflects the context by which vulnerability exploitation is possible. This metric value (and consequently the resulting severity) will be larger the more remote (logically, and physically) an attacker can be in order to exploit the vulnerable system. The assumption is that the number of potential attackers for a vulnerability that could be exploited from across a network is larger than the number of potential attackers that could exploit a vulnerability requiring physical access to a device, and therefore warrants a greater severity.
Attack Complexity: This metric captures measurable actions that must be taken by the attacker to actively evade or circumvent existing built-in security-enhancing conditions in order to obtain a working exploit. These are conditions whose primary purpose is to increase security and/or increase exploit engineering complexity. A vulnerability exploitable without a target-specific variable has a lower complexity than a vulnerability that would require non-trivial customization. This metric is meant to capture security mechanisms utilized by the vulnerable system.
Attack Requirements: This metric captures the prerequisite deployment and execution conditions or variables of the vulnerable system that enable the attack. These differ from security-enhancing techniques/technologies (ref Attack Complexity) as the primary purpose of these conditions is not to explicitly mitigate attacks, but rather, emerge naturally as a consequence of the deployment and execution of the vulnerable system.
Privileges Required: This metric describes the level of privileges an attacker must possess prior to successfully exploiting the vulnerability. The method by which the attacker obtains privileged credentials prior to the attack (e.g., free trial accounts), is outside the scope of this metric. Generally, self-service provisioned accounts do not constitute a privilege requirement if the attacker can grant themselves privileges as part of the attack.
User interaction: This metric captures the requirement for a human user, other than the attacker, to participate in the successful compromise of the vulnerable system. This metric determines whether the vulnerability can be exploited solely at the will of the attacker, or whether a separate user (or user-initiated process) must participate in some manner.
Vulnerable System Impact Metrics
Confidentiality: This metric measures the impact to the confidentiality of the information managed by the VULNERABLE SYSTEM due to a successfully exploited vulnerability. Confidentiality refers to limiting information access and disclosure to only authorized users, as well as preventing access by, or disclosure to, unauthorized ones.
Integrity: This metric measures the impact to integrity of a successfully exploited vulnerability. Integrity refers to the trustworthiness and veracity of information. Integrity of the VULNERABLE SYSTEM is impacted when an attacker makes unauthorized modification of system data. Integrity is also impacted when a system user can repudiate critical actions taken in the context of the system (e.g. due to insufficient logging).
Availability: This metric measures the impact to the availability of the VULNERABLE SYSTEM resulting from a successfully exploited vulnerability. While the Confidentiality and Integrity impact metrics apply to the loss of confidentiality or integrity of data (e.g., information, files) used by the system, this metric refers to the loss of availability of the impacted system itself, such as a networked service (e.g., web, database, email). Since availability refers to the accessibility of information resources, attacks that consume network bandwidth, processor cycles, or disk space all impact the availability of a system.
Subsequent System Impact Metrics
Confidentiality: This metric measures the impact to the confidentiality of the information managed by the SUBSEQUENT SYSTEM due to a successfully exploited vulnerability. Confidentiality refers to limiting information access and disclosure to only authorized users, as well as preventing access by, or disclosure to, unauthorized ones.
Integrity: This metric measures the impact to integrity of a successfully exploited vulnerability. Integrity refers to the trustworthiness and veracity of information. Integrity of the SUBSEQUENT SYSTEM is impacted when an attacker makes unauthorized modification of system data. Integrity is also impacted when a system user can repudiate critical actions taken in the context of the system (e.g. due to insufficient logging).
Availability: This metric measures the impact to the availability of the SUBSEQUENT SYSTEM resulting from a successfully exploited vulnerability. While the Confidentiality and Integrity impact metrics apply to the loss of confidentiality or integrity of data (e.g., information, files) used by the system, this metric refers to the loss of availability of the impacted system itself, such as a networked service (e.g., web, database, email). Since availability refers to the accessibility of information resources, attacks that consume network bandwidth, processor cycles, or disk space all impact the availability of a system.
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N/E:P

EPSS score

Weaknesses

Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. Learn more on MITRE.

CVE ID

No known CVE

GHSA ID

GHSA-4mgv-366x-qxvx

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.