Monitor vulnerabilities like this one.
Sign up free to get alerted when software you use is affected.
1.8
Craft CMS User Permissions Page Allows Malicious Code Execution
GHSA-g3hp-vvqf-8vw6
Summary
A security issue in Craft CMS can allow an attacker to inject malicious code into the user permissions page, which can be triggered when another user views or edits a user's permissions. This can happen when an admin creates or edits a user group with a specially crafted name. To protect your site, make sure to sanitize user group names when rendering them in the user permissions template.
What to do
- Update craftcms cms to version 5.8.22.
Affected software
| Vendor | Product | Affected versions | Fix available |
|---|---|---|---|
| craftcms | cms | > 5.0.0-RC1 , <= 5.8.21 | 5.8.22 |
Original title
Craft CMS Vulnerable to Stored XSS via User Group Name in User Permissions Page
Original description
## Summary
A stored XSS vulnerability exists in the User Permissions page. The User Group name is rendered without proper HTML escaping in the permissions section, allowing an attacker to execute arbitrary JavaScript when another user views or edits a user's permissions.
> [!NOTE]
> This is a separate vulnerability from the previously reported "[Stored XSS via User Group Name in User Settings Page](https://github.com/craftcms/cms/security/advisories/GHSA-2423-8xxj-wc3g)" and "[Multiple Stored XSS in User Group Edit Page](https://github.com/craftcms/cms/security/advisories/GHSA-vx7g-xw92-g4xj)". This affects a different sink: the individual user's permissions page.
## Proof of Concept
### Required Permissions
- Admin access
- `allowAdminChanges` is enabled in production, which is against our [security recommendations](https://craftcms.com/knowledge-base/securing-craft).
### Steps to Reproduce
1. Log in to the control panel as an admin
2. Navigate to **Settings → Users → User Groups**
3. Create or edit a user group and set the **Name** field to:
```html
<img src=x onerror="alert('XSS')" hidden>
```
4. Save the user group
5. Navigate to **Users** and edit any user (`/admin/users/{id}`)
6. Click on the **Permissions** tab
7. XSS executes
## Mitigation
Sanitize user group names when rendering in the user permissions template.
## References
https://github.com/craftcms/cms-ghsa-4mgv-366x-qxvx/pull/2
A stored XSS vulnerability exists in the User Permissions page. The User Group name is rendered without proper HTML escaping in the permissions section, allowing an attacker to execute arbitrary JavaScript when another user views or edits a user's permissions.
> [!NOTE]
> This is a separate vulnerability from the previously reported "[Stored XSS via User Group Name in User Settings Page](https://github.com/craftcms/cms/security/advisories/GHSA-2423-8xxj-wc3g)" and "[Multiple Stored XSS in User Group Edit Page](https://github.com/craftcms/cms/security/advisories/GHSA-vx7g-xw92-g4xj)". This affects a different sink: the individual user's permissions page.
## Proof of Concept
### Required Permissions
- Admin access
- `allowAdminChanges` is enabled in production, which is against our [security recommendations](https://craftcms.com/knowledge-base/securing-craft).
### Steps to Reproduce
1. Log in to the control panel as an admin
2. Navigate to **Settings → Users → User Groups**
3. Create or edit a user group and set the **Name** field to:
```html
<img src=x onerror="alert('XSS')" hidden>
```
4. Save the user group
5. Navigate to **Users** and edit any user (`/admin/users/{id}`)
6. Click on the **Permissions** tab
7. XSS executes
## Mitigation
Sanitize user group names when rendering in the user permissions template.
## References
https://github.com/craftcms/cms-ghsa-4mgv-366x-qxvx/pull/2
ghsa CVSS4.0
1.8
Vulnerability type
CWE-79
Cross-site Scripting (XSS)
Published: 11 Mar 2026 · Updated: 13 Mar 2026 · First seen: 11 Mar 2026