Summary
Statamic versions 6.0.0 to before 6.2.3 contain a stored cross-site scripting (XSS) vulnerability where content titles are not safely sanitized before being rendered in the control panel UI.
Authenticated users with content creation permissions can inject malicious JavaScript into titles, which then executes in the browser of higher-privileged users and can be abused to create super admin accounts.
Affected context
This vulnerability affects Statamic installations where:
- Users have control panel access and permissions to create or edit content entries
- Content titles are rendered in administrative or editorial interfaces without sufficient output encoding
- Higher-privileged users (e.g., super admins) review or manage content that includes attacker-controlled titles
The issue manifests in the control panel views where titles are displayed, rather than on the public-facing site by default.
Exploit preconditions
- Attack surface: Statamic control panel and any internal interfaces that render content titles.
- Required access: An authenticated account with control panel access and content creation permissions.
- Trigger point: Viewing a list, detail page, or any UI component in the control panel that renders the crafted content title in a browser.
- Why exploitation is possible: User-supplied title fields are stored and later rendered as HTML without adequate context-aware escaping or sanitization, allowing embedded script code to execute in the victim's session.
Why this happens
The underlying bug aligns with CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-site Scripting).
User-controlled content titles are persisted in the application and then incorporated into server-rendered or client-rendered HTML without strict output encoding. Because the rendering logic treats these values as trusted text in an HTML context, any scripts or event handlers embedded in the title are interpreted by the browser. This stored XSS pattern arises when the application does not consistently escape untrusted data according to the specific context (HTML body, attribute, JavaScript, etc.) in which it is inserted, especially within admin-facing views.
Potential impact
- Malicious JavaScript execution in the browser of super admins or other privileged users
- Creation or takeover of super admin accounts through session hijacking or CSRF-style actions performed by injected scripts
- Unauthorized changes to site configuration, content, or user roles
- Exfiltration of sensitive data accessible via the control panel, including API keys or access tokens displayed in the UI
- Lateral movement to other integrated systems if administrative sessions have linked access
General mitigation guidance
Effective mitigation centers on treating all user-controlled content as untrusted and encoding it at output:
- Apply context-aware output encoding to content titles wherever they are rendered (HTML, attributes, JavaScript, JSON, etc.).
- Normalize the handling of rich and plain text fields, ensuring that title fields are treated as plain text and never interpreted as HTML unless strictly required.
- Implement central helper functions or templating directives that enforce escaping by default, making unescaped output an explicit, rare exception.
- Enforce least-privilege principles for control panel roles so that only trusted users can create or modify content visible to super admins.
- Consider server-side validation rules that reject obviously unsafe constructs in fields meant to be plain text (e.g., script tags or event handler attributes).
How teams detect issues like this
Detection typically involves a combination of code review and automated checks:
- Static analysis or linters configured to flag unescaped output of user-controlled fields in templates and views, especially in admin interfaces.
- Manual review of Blade, Twig, or other template files to verify that title fields and similar content are rendered using escaping helpers instead of raw output functions.
- Security tests that seed content fields (including titles) with benign XSS test payloads and confirm they are rendered safely in all control panel views.
- CI/CD policies that prevent merging changes when new instances of raw HTML rendering of user-controlled data are introduced.

