CVE-2026-27197: Verified Repro With Script Download
CVE-2026-27197: Statamic CMS Stored XSS via Markdown Fieldtype
CVE-2026-27197 is verified against statamic/cms · composer. Vulnerability class: XSS. This critical reproduction includes runnable sandbox proof, artifacts, and a plain-text agent view under REPRO-2026-00112.
What Is CVE-2026-27197?
CVE-2026-27197 (GHSA-8r7r-f4gm-wcpq) is a high-severity stored Cross-Site Scripting (XSS) vulnerability in Statamic CMS, exploitable through the Markdown/HTML fieldtype. Pruva reproduced it (reproduction REPRO-2026-00112).
CVE-2026-27197 Severity & CVSS Score
CVE-2026-27197 is rated critical severity, with a CVSS base score of 9.1 out of 10.
Critical — the most severe class — typically remotely exploitable with severe impact. Treat as an emergency.
How to Reproduce CVE-2026-27197
pruva-verify REPRO-2026-00112 curl -O https://pruva.dev/api/v1/reproductions/REPRO-2026-00112/artifacts/reproduction_steps.sh && chmod +x reproduction_steps.sh && ./reproduction_steps.sh Proof of Reproduction for CVE-2026-27197
Reproduced by Pruva's autonomous agents — 87 tool calls over 8 min. Full root-cause analysis and the complete transcript are below.
How the agent worked
Root Cause and Exploit Chain for CVE-2026-27197
Summary
This report documents a stored Cross-Site Scripting (XSS) vulnerability in Statamic CMS identified as GHSA-8r7r-f4gm-wcpq (CVE-2026-27196). The vulnerability exists in the HtmlFieldtype.vue component, which renders raw HTML content without sanitization. Authenticated users with field management permissions can inject malicious JavaScript code into HTML field configurations, which executes when viewed by higher-privileged users (such as administrators) in the Control Panel. This enables privilege escalation attacks where a lower-privileged user can potentially compromise admin accounts.
Impact
Package: statamic/cms (Composer) Affected Versions:
>= 6.0.0-alpha.1, < 6.3.2< 5.73.9
Patched Versions: 6.3.2, 5.73.9
Risk Level: HIGH (CVSS 8.1)
CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:N
Consequences:
- Privilege escalation via stored XSS
- Malicious JavaScript execution in admin context
- Potential account takeover of higher-privileged users
- Data theft and unauthorized administrative actions
Root Cause
The vulnerability stems from improper output encoding in the HtmlFieldtype.vue component. The original code directly renders user-controlled HTML content using Vue's v-html directive without any sanitization:
<template>
<div v-html="config.html" />
</template>
<script>
import Fieldtype from './Fieldtype.vue';
export default {
mixins: [Fieldtype],
};
</script>
The config.html property is set by users with field management permissions when configuring HTML fieldtypes. Since the content is rendered directly without sanitization, an attacker can inject malicious JavaScript such as:
<script>fetch('/admin/users/create?email=attacker@evil.com&password=backdoor123')</script>
When an administrator views a form containing this malicious HTML field, the JavaScript executes in their browser with their authenticated session.
Fix Commit: https://github.com/statamic/cms/commit/11ae40e62edd3da044d37ebf264757a09cc2347b
The fix adds DOMPurify library to sanitize HTML content before rendering:
<script setup>
import Fieldtype from '@/components/fieldtypes/fieldtype';
import { computed } from 'vue';
import DOMPurify from 'dompurify';
const props = defineProps(Fieldtype.props);
const html = computed(() => props.config.sanitize ? DOMPurify.sanitize(props.config.html) : props.config.html);
</script>
<template>
<div v-html="html" />
</template>
Reproduction Steps
The reproduction script repro/reproduction_steps.sh performs the following:
- Clones Statamic CMS repository at the vulnerable version (v6.3.1)
- Examines the
resources/js/components/fieldtypes/HtmlFieldtype.vuefile - Detects the presence of the vulnerable pattern:
v-html="config.html"without sanitization - Confirms DOMPurify is NOT present in the file
- Generates evidence logs showing the vulnerable code
To run:
./repro/reproduction_steps.sh
Expected Output:
- Confirmation that
v-html="config.html"is present in the file - Confirmation that DOMPurify sanitization is NOT present
- Exit code 0 indicating vulnerability confirmed
Evidence
Log Files:
logs/clone.log- Git clone outputlogs/html_fieldtype_original.vue- Full content of vulnerable componentlogs/vulnerability.confirmed- Confirmation of vulnerable patternlogs/vulnerable_code.vue- Copy of vulnerable source codelogs/patch.diff- Diff of the security fix (if fetched)
Key Evidence Excerpts:
From logs/vulnerable_code.vue:
<template>
<div v-html="config.html" />
</template>
<script>
import Fieldtype from './Fieldtype.vue';
export default {
mixins: [Fieldtype],
};
</script>
The presence of v-html="config.html" without any sanitization library (DOMPurify) confirms the vulnerability exists in this version.
Recommendations / Next Steps
Immediate Actions:
- Upgrade to Statamic CMS 6.3.2 or 5.73.9 (or later)
- Audit existing HTML fieldtype configurations for malicious content
- Review access logs for suspicious admin activity
Fix Approach: The vendor has correctly addressed this issue by:
- Adding DOMPurify library for HTML sanitization
- Adding a configurable
sanitizetoggle (default: true) - Wrapping the HTML content in a computed property that applies sanitization
Testing Recommendations:
- Add automated tests that verify XSS payloads are sanitized
- Implement Content Security Policy (CSP) headers as defense in depth
- Regular security audits of fieldtype components
- Consider using Vue's text interpolation (
{{ }}) instead ofv-htmlwhere possible
Defense in Depth:
- Implement strict CSP headers to prevent inline script execution
- Enable the
sanitizeoption in HTML fieldtype configurations - Regularly audit user permissions for field management capabilities
Additional Notes
Idempotency Confirmation: The reproduction script has been tested and passes consistently on consecutive runs. It:
- Cleans up previous runs (
rm -rfon statamic directory) - Performs fresh git clone each time
- Produces identical results confirming the vulnerability exists in v6.3.1
Edge Cases / Limitations:
- This reproduction demonstrates the code-level vulnerability but does not set up a full Statamic instance with database
- Full exploitation would require an actual Statamic installation with:
- A user account with field management permissions
- An admin user to view the malicious form
- The JavaScript payload would execute in the admin's browser session
- The vulnerability requires authenticated access with specific permissions (field management)
- The CVSS score reflects required user interaction (UI:R) and high privileges (PR:H)
Related CVEs:
- CVE-2026-27196: The primary identifier for this vulnerability
- GHSA-8r7r-f4gm-wcpq: GitHub Security Advisory identifier
Additional References:
CVE-2026-27197 Reproduction Transcript
The agent's step-by-step process — every tool call, every handoff, the moment the exploit fired.
Full session Replay every step — scrub the timeline or play it back.
curl -sL https://github.com/statamic/cms/commit/11ae40e62edd3da044d37ebf264757a09cc2347b.patch | head -200{"cwd":"/root/.pruva/runs/ghsa-8r7r-f4gm-wcpq_20260220-150224","duration_ms":366,"exit_code":0,"stderr":"","stdout":"From 11ae40e62edd3da044d37ebf264757a09cc2347b Mon Sep 17 00:00:00 2001\nFrom: Jason Varga <jason@pixelfear.com>\nDate: Wed, 18 Feb 2026 13:41:43 -0500\nSubject: [PATCH] [6.x] Sanitize html in html fieldtype (#13990)\n\n---\n lang/en/fieldtypes.php | 1 +\n package-lock.json | 17 +++++++++++++++++\n package.json | 1 +\n .../js/components/fieldtypes/HtmlFieldtype.vue | 18 ++++++++++--------\n src/Fieldtypes/Html.php | 6 ++++++\n 5 files changed, 35 insertions(+), 8 deletions(-)\n\ndiff --git a/lang/en/fieldtypes.php b/lang/en/fieldtypes.php\nindex 1267da4ec98..9f4ddea6a4e 100644\n--- a/lang/en/fieldtypes.php\n+++ b/lang/en/fieldtypes.php\n@@ -110,6 +110,7 @@\n 'group.title' => 'Group',\n 'hidden.title' => 'Hidden',\n 'html.config.html_instruct' => 'Manage the HTML to be displayed in the publish form. This is for display purposes only, the HTML will not be saved.',\n+ 'html.config.sanitize_instruct' => 'Whether the HTML should be sanitized befor… [truncated]curl -sL https://github.com/statamic/cms/commit/6c270dacc2be02bfc2eee500766f3309f59d47b3.patch | head -200{"cwd":"/root/.pruva/runs/ghsa-8r7r-f4gm-wcpq_20260220-150224","duration_ms":205,"exit_code":0,"stderr":"","stdout":"From 6c270dacc2be02bfc2eee500766f3309f59d47b3 Mon Sep 17 00:00:00 2001\nFrom: Jason Varga <jason@pixelfear.com>\nDate: Wed, 18 Feb 2026 13:54:39 -0500\nSubject: [PATCH] [5.x] Sanitize html in html fieldtype (#13992)\n\n---\n package-lock.json | 17 +++++++++++++++++\n package.json | 1 +\n .../js/components/fieldtypes/HtmlFieldtype.vue | 11 +++++++++--\n 3 files changed, 27 insertions(+), 2 deletions(-)\n\ndiff --git a/package-lock.json b/package-lock.json\nindex 1e76e54d691..216fe84b45f 100644\n--- a/package-lock.json\n+++ b/package-lock.json\n@@ -46,6 +46,7 @@\n \"body-scroll-lock\": \"^4.0.0-beta.0\",\n \"codemirror\": \"^5.58.2\",\n \"cookies-js\": \"^1.2.2\",\n+ \"dompurify\": \"^3.3.1\",\n \"floating-vue\": \"^1.0.0-beta.19\",\n \"fuse.js\": \"^7.0.0\",\n \"highlight.js\": \"^11.7.0\",\n@@ -3661,6 +3662,13 @@\n \"integrity\": \"sha512-Q5vtl1W5ue16D+nIaW8JWebSSraJVlK+EthKn7e7UcD4KWsaSJ8BqGPXNaPghgtcn/fhvrN17Tv8ksUsQpiplw==\",\n \"de… [truncated]Artifacts and Evidence for CVE-2026-27197
Scripts, logs, diffs, and output captured during the reproduction.
No artifacts available
How to Fix CVE-2026-27197
FAQ: CVE-2026-27197
How does the CVE-2026-27197 stored XSS attack work?
How severe is CVE-2026-27197?
How can I reproduce CVE-2026-27197?
References for CVE-2026-27197
Authoritative sources for CVE-2026-27197 — official vulnerability databases and the upstream advisory. Pruva's reproduction verifies the issue firsthand; these are the primary records to corroborate it.