MediumGHSA-2rp4-x2j7-qmccCVE-2026-72787

Craft CMS: Stored XSS in the control panel via unescaped draft name

Published 6 Aug 2026 · Updated 13 Aug 2026

Is your project on an affected craftcms/cms?

Private repo? Upload its lockfile instead, or connect GitHub to check every repo.

Look after several Laravel or PHP apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie

Affected package

craftcms/cmsComposer
Affected
>=5.0.0-RC1 <5.10.8
Fixed in
5.10.8
Update to the fixed version for your release line, for example:composer require craftcms/cms:^5.10.8

Details

The control-panel helper that renders element chip/card labels writes an element's draftName into the page without HTML-encoding it, while the surrounding path segments are encoded.

A low-privilege control-panel user who can create a draft of an element (for example, an entry) controls the draft name, so they can store an XSS payload that executes in the browser of any other control-panel user who is shown that element’s chip or card (element indexes with drafts visible, relation and element-selection fields that reference the element, and the drafts list).

This allows a low-privilege author to run JavaScript in an administrator’s authenticated session and take over the control panel. It is the same output-encoding class as the recently fixed GHSA-xrqc-p465-2xvg (Structure entry title) and GHSA-3x4w-mxpf-fhqq (revision context menu), which encoded other user-controlled titles but not the draft name.

Prerequisites

  • A control-panel account with permission to edit entries in at least one section and create drafts.
  • A higher-privileged user (for example, an administrator) who is later shown the draft’s chip or card (an element index with drafts visible, or a relation/element-selection field referencing the element).

Limitations

  • Requires the victim to be shown the affected element's chip/card in the control panel (normal day-to-day activity; element indexes and relation fields are routine).
  • The payload runs in the control-panel origin in the victim’s session.

Impact

A low-privilege author can run arbitrary JavaScript in the session of any higher-privileged control-panel user who is shown the element’s chip or card, including administrators. This is a cross-privilege stored XSS, not a self-XSS: the attacker and the victim are different users, and the payload fires during routine browsing of element indexes and relation fields.

Because the script runs in the victim’s control-panel origin, it can read the CSRF token that Craft embeds in the page JavaScript (Craft.csrfTokenValue, confirmed present on control-panel pages) and issue authenticated control-panel actions as the victim. This was verified end-to-end on Craft Pro: an in-session request to the users/save-user action created a brand new account (User saved., HTTP 200), an admin-only capability that an author can never perform directly.

Is GHSA-2rp4-x2j7-qmcc in any of your client repos?

Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected craftcms/cms, and gives you the command that fixes it.

More advisories for craftcms/cms

  • CriticalCVE-2026-72780Craft CMS: Passkey login accepts replayed WebAuthn assertions · 7 Aug 2026
  • MediumCVE-2026-72779Craft CMS: Arbitrary file read via SplFileObject in non-sandboxed template contexts · 6 Aug 2026
  • MediumCVE-2026-72782Craft CMS: Authenticated leak of secret environment variables · 6 Aug 2026
  • MediumCVE-2026-72785Craft CMS: Authorization bypass: view-only Categories user can modify category structure via structures/move-element · 6 Aug 2026
  • MediumCVE-2026-14794Craft CMS: Missing authorization check allows non-admin control panel users access to user registration metrics · 6 Aug 2026
  • LowCVE-2026-72783Craft CMS: Incorrect path validation could potentially lead to path traversal · 6 Aug 2026
All 127 advisories for craftcms/cms

References

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.