5.9medium
Craft CMS: Stored XSS via Structure entry title in table view
- Severity
- 5.9medium CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.32% (higher than 26% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-xrqc-p465-2xvg
Description
Craft CMS is a content management system (CMS). In versions 5.0.0-RC1 through 5.9.22, an author-level control panel user can store a malicious JavaScript payload in an entry title. When an admin, or any control panel user with saveEntries for the same Structure section, drags another entry under the poisoned entry in table view, the payload executes in the victim’s session. The issue is exploitable because the title is escaped into data-title by the server, decoded again by the browser, read with jQuery .data('title'), and then concatenated into a new HTML string without attribute escaping. To exploit, an attacker must have an existing control panel account (Author role minimum), the victim must perform a drag operation (not just visit the page), and the victim’s session needs to be elevated at trigger time. This issue has been fixed in version 5.9.23.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| craftcms cms | >= 5.0.0-RC1, < 5.9.23 | CVE List |
| craftcms/cms (Packagist) | from 5.0.0-RC1 before 5.9.53 | GitHub Advisory Database |
All scores
| GitHub_M | 5.9medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:P/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N |
| GitHub | medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:P/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N |
Classification
SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.
What each source says
CVE List
Craft CMS is a content management system (CMS). In versions 5.0.0-RC1 through 5.9.22, an author-level control panel user can store a malicious JavaScript payload in an entry title. When an admin, or any control panel user with saveEntries for the same Structure section, drags another entry under the poisoned entry in table view, the payload executes in the victim’s session. The issue is exploitable because the title is escaped into data-title by the server, decoded again by the browser, read with jQuery .data('title'), and then concatenated into a new HTML string without attribute escaping. To exploit, an attacker must have an existing control panel account (Author role minimum), the victim must perform a drag operation (not just visit the page), and the victim’s session needs to be elevated at trigger time. This issue has been fixed in version 5.9.23.
GitHub Advisory Database
Stored XSS via Structure entry title in table view
Summary
An Author-level control panel user can store a JavaScript payload in an entry title. When an admin, or any control panel user with saveEntries for the same Structure section, drags another entry under the poisoned entry in table view, the payload executes in the victim’s session.
The issue is exploitable because the title is escaped into data-title by the server, decoded again by the browser, read with jQuery .data('title'), and then concatenated into a new HTML string without attribute escaping.
Execution was verified with alert(document.domain). Impact was verified against an elevated admin session by changing the admin user’s email through users/save-user, then using the password-reset flow to take over the account.
Preconditions
- Attacker has
createEntries+saveEntrieson a Structure-type section (Author-style CP account; no admin permission required). - Victim has
saveEntrieson the same section. Craft only renders drag handles whenstructureEditableis true, which requires this permission, so any admin qualifies. - Section must be type Structure. Channel and Single sections are unaffected.
- Poisoned entry must have no children at the time of the drag (fires on the 0-to-1 descendant transition).
- For the email-change account-takeover path, the victim must currently have an elevated session. The stored XSS itself does not require elevation.
Root cause
ElementTableSorter.js lines 643-652:
const ancestorTitle = this._updateAncestors._$ancestor.data('title');
$(
'<button … aria-label="' +
Craft.t('app', 'Show {title} children', {title: ancestorTitle}) +
'"></button>'
).insertAfter(…);
Craft.t with a {title} token calls _parseToken, reaches case 'none': return arg (Craft.js:193-194), and returns the title verbatim. The result is handed to jQuery's $() and parsed as HTML.
The server-side template correctly encodes the entry title into data-title, but the browser decodes that attribute before jQuery returns it from .data('title'). At that point the value is attacker-controlled HTML, and it is inserted into the aria-label attribute without Craft.escapeHtml().
Steps to reproduce
Plant (attacker - Author account):
python3 poc.py --url http://target --cp admin \
--user author@example.com --pass secret --section mySection
Trigger (victim - any control panel user with saveEntries, e.g. admin):
- Open the section index in Table view.
- Drag the "Drag me" entry and drop it as the first child of the poisoned entry.
alert(document.domain) fires in the victim’s session.
Impact payload tested in an elevated admin session (249 chars, within the 255-char title limit):
"><img src=x onerror="fetch(Craft.actionUrl+'users/save-user',{method:'POST',body:Craft.csrfTokenName+'='+encodeURIComponent(Craft.csrfTokenValue)+'&userId=1&email=attacker%40evil.com',headers:{'Content-Type':'application/x-www-form-urlencoded'}})">
When triggered during an elevated admin session, the admin’s email is changed to the attacker-controlled address. The attacker can then request a password reset and receive the reset link.
Impact
Stored XSS in the control panel from an Author-level account. The payload runs as the victim control panel user and can use Craft.csrfTokenName / Craft.csrfTokenValue to send same-origin action requests as that user.
In my test environment, triggering the payload in an elevated admin session allowed Author-to-admin account takeover via admin email change and password reset.
Mitigating factors
- Requires an existing control panel account (Author role minimum).
- Victim must perform a drag operation, not just visit the page.
- The demonstrated email-change takeover requires the victim’s session to be elevated at trigger time.
Resources
https://github.com/craftcms/cms/commit/162321e899cc97517fb6f5a02b5528f549d0c6cc
NVD (es)
Craft CMS es un sistema de gestión de contenido (CMS). En las versiones 5.0.0-RC1 hasta la 5.9.22, un usuario del panel de control con nivel de autor puede almacenar una carga útil de JavaScript maliciosa en el título de una entrada. Cuando un administrador, o cualquier usuario del panel de control con permisos ’saveEntries’ para la misma sección de Estructura, arrastra otra entrada debajo de la entrada ’envenenada’ en la vista de tabla, la carga útil se ejecuta en la sesión de la víctima. El problema es explotable porque el título es escapado a ’data-title’ por el servidor, decodificado de nuevo por el navegador, leído con jQuery .data(’title’), y luego concatenado en una nueva cadena HTML sin escape de atributos. Para explotar, un atacante debe tener una cuenta existente en el panel de control (rol de Autor como mínimo), la víctima debe realizar una operación de arrastre (no solo visitar la página), y la sesión de la víctima debe estar elevada en el momento del disparo. Este problema ha sido solucionado en la versión 5.9.23.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-55793 changed 2026-07-02 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-xrqc-p465-2xvg changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2026-55793 changed 2026-10-25 | Public domain |