GHSA-2rp4-x2j7-qmcc: Craft CMS: Stored XSS in the control panel via unescaped draft name
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.
References
Code Behaviors & Features
Detect and mitigate GHSA-2rp4-x2j7-qmcc with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →