/

CVE-2026-27196

Severity:

HIGH RISK

(8.1)

Cross-Site Scripting (Stored XSS) in Statamic HTML

CVE-2026-27196

Analyzed

Vulnerability type

Category:

Cross-Site Scripting (Stored XSS)

CWE:

CWE-79

Impact:

Privilege escalation via stored client-side code execution in the Statamic control panel

Severity:

HIGH RISK

(8.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Statamic CMS versions 5.73.8 and below, and 6.0.0-alpha.1 through 6.3.1, contain a stored cross-site scripting (XSS) vulnerability in HTML fieldtypes that allows authenticated users with field management permissions to inject malicious JavaScript.

The injected script executes when higher-privileged users view the affected content, potentially enabling privilege abuse and account compromise within the administrative interface.

Affected context

The vulnerability exists in Statamic installations that:

  • Use HTML fieldtypes in content or configuration schemas, and
  • Grant some users permissions to create or manage fields and fieldsets, and
  • Allow higher-privileged users (e.g., admins, content architects) to view or edit content that includes those HTML fields via the control panel.

It manifests when user-supplied HTML is rendered without sufficient sanitization or encoding in the browser context for other users, especially those with higher privileges.

Exploit preconditions

  • Attack surface: Statamic control panel and any interface where HTML fieldtypes are rendered.
  • Required access: Authenticated Statamic user with permissions to manage or configure fields/fieldsets that use the vulnerable HTML fieldtype.
  • Trigger point: Viewing of the crafted field content or configuration by another user, particularly a higher-privileged account, in the Statamic control panel or related views.
  • Why exploitation is possible: User-controlled HTML from field definitions is stored and later rendered as active HTML/JavaScript in other users' browsers without robust sanitization and output encoding, allowing persistent script execution.

Why this happens

This issue is rooted in insufficient output encoding and sanitization of user-controllable HTML content associated with Statamic's HTML fieldtypes.

The application stores attacker-supplied HTML in configuration or content and later renders it in privileged users' browsers within the same origin as the Statamic control panel. This behavior aligns with CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-site Scripting), where untrusted input is integrated into a web page without proper neutralization, enabling execution of arbitrary JavaScript in the victim's session.

Potential impact

  • Theft of session tokens or CSRF tokens from higher-privileged users' browsers
  • Execution of privileged actions on behalf of an administrator (e.g., creating new users, changing settings, editing content)
  • Unauthorized modification or defacement of site content and configuration
  • Creation of hidden backdoor administrator accounts through UI-driven actions
  • Pivoting into broader application compromise if administrative capabilities are abused

General mitigation guidance

Effective mitigation focuses on treating all HTML associated with field configurations as untrusted and limiting its ability to run active script:

  • Prefer fieldtypes and UI components that store data, not raw executable HTML, especially for configuration or shared fields.
  • Apply robust context-aware output encoding whenever user-controlled content is rendered in the control panel or other authenticated interfaces.
  • Introduce strict server-side sanitization for HTML fields, stripping or normalizing dangerous constructs such as script tags, inline event handlers, and javascript: URLs.
  • Use a positive-security model for allowed HTML (e.g., an allowlist-based sanitizer) rather than attempting to block known-bad patterns.
  • Enforce least-privilege permissions for field and fieldset management so that only trusted administrators can define or edit HTML fieldtypes.
  • Consider separating configuration-editing privileges from day-to-day content editing roles to reduce exposure if an account is compromised.

How teams detect issues like this

Organizations can detect and manage similar XSS risks in CMS platforms through:

  • Static analysis and code review:
  • Flag locations where raw HTML from configuration or database fields is directly echoed into templates without escaping.
  • Look for template constructs or helper functions that bypass encoding (e.g., "raw" or "unescaped" output modes) when handling user-controlled content.
  • Review fieldtype and form rendering logic for missing sanitization or reliance on client-side filters only.
  • Security testing:
  • Include stored XSS test cases in QA for all custom fieldtypes and control panel views.
  • Use automated application security scanners configured to crawl authenticated control panel routes and input forms.
  • Policy and process:
  • Incorporate secure templating guidelines that mandate encoded output by default and require justification for exceptions.
  • Use CI-based linting or SAST tools to enforce patterns like "no unescaped HTML from user fields."

Sources

SourceLink
github.comgithub.com/statamic/cms/commit/11ae40e62edd3da044d37ebf264757a09cc2347b
github.comgithub.com/statamic/cms/commit/6c270dacc2be02bfc2eee500766f3309f59d47b3
github.comgithub.com/statamic/cms/security/advisories/GHSA-8r7r-f4gm-wcpq

Frequently asked

questions

Yes, if the Statamic control panel is exposed over the internet and an attacker can obtain valid credentials with field management permissions. The actual script execution occurs in the browser of any user who later views the malicious field content.

No. The attacker only needs an authenticated account with sufficient permissions to manage or configure HTML fieldtypes. The goal is typically to have their payload viewed by an administrator or higher-privileged user, whose browser then executes the script.

The most robust fix pattern is to ensure all user-controlled data, including HTML field content and configuration, is properly sanitized and contextually encoded before being rendered, and to avoid rendering raw HTML in the control panel wherever possible. Additionally, design fieldtypes so that stored content is treated as data rather than executable markup.

Use a templating system that encodes output by default, adopt an allowlist-based HTML sanitizer for any fields that must support HTML, restrict permissions for defining or editing HTML-capable fields, and integrate automated security testing that specifically checks for stored XSS in administrative and configuration views.

Find out what's already
exploitable in your codebase.