Description
Grav v2.0.0 contains a cross-site scripting vulnerability (fixed in 2.0.1). The XSS blueprint validator (Security::detectXss()) runs on raw page content before Twig processing. When Twig content processing is enabled (twig_content.process_enabled: true), an attacker with page-write API permission can use Twig's string concatenation operator (~) to dynamically construct event handler names, dangerous tag names, or dangerous protocols at render time (e.g. {% set x = "on" ~ "error" %}). The validator sees only the harmless Twig expression and allows the content, but after Twig rendering the output (rendered via {{ page.content|raw }}) contains an active payload such as <img src=1 onerror=alert(1)>, executing arbitrary JavaScript in visitors' browsers.
Published: 2026-07-15
Score: 5.1 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

Grav version 2.0.0 contains a cross‑site scripting flaw that is triggered when Twig string concatenation is used within page content. The validator runs before Twig processes the content, so it can not detect dynamic construction of potentially dangerous attributes or tags. After Twig renders the content, the concatenated payload becomes a valid XSS vector such as an image tag with an onerror handler, executing JavaScript in the victim’s browser.

Affected Systems

The vulnerability affects Grav content management systems prior to version 2.0.1, specifically version 2.0.0. All installations that enable Twig content processing (twig_content.process_enabled: true) and allow page‑write API permissions are susceptible.

Risk and Exploitability

The CVSS score of 5.1 indicates moderate severity. The EPSS score is below 1%, meaning exploitation is unlikely but not impossible. The flaw is not listed in CISA’s KEV catalog. An attacker who can write page content via the API can inject the vulnerable Twig expression and, if the site renders page content raw, will successfully deliver a cross‑site scripting payload to visitors. The attack requires privileges to modify page content but does not need higher-level system access.

Generated by OpenCVE AI on July 31, 2026 at 03:54 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade Grav to version 2.0.1 or later to apply the fix that corrects the XSS validation process
  • If an upgrade is not immediately possible, disable dynamic Twig content processing by setting twig_content.process_enabled to false or restrict it to trusted users
  • Ensure that only authorized users have page‑write API permissions and consider additional input sanitization for page content before rendering

Generated by OpenCVE AI on July 31, 2026 at 03:54 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Wed, 15 Jul 2026 18:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Wed, 15 Jul 2026 12:00:00 +0000

Type Values Removed Values Added
Description Grav v2.0.0 contains a cross-site scripting vulnerability (fixed in 2.0.1). The XSS blueprint validator (Security::detectXss()) runs on raw page content before Twig processing. When Twig content processing is enabled (twig_content.process_enabled: true), an attacker with page-write API permission can use Twig's string concatenation operator (~) to dynamically construct event handler names, dangerous tag names, or dangerous protocols at render time (e.g. {% set x = "on" ~ "error" %}). The validator sees only the harmless Twig expression and allows the content, but after Twig rendering the output (rendered via {{ page.content|raw }}) contains an active payload such as <img src=1 onerror=alert(1)>, executing arbitrary JavaScript in visitors' browsers.
Title Grav before 2.0.1 XSS via Twig String Concatenation
First Time appeared Getgrav
Getgrav grav
Weaknesses CWE-79
CPEs cpe:2.3:a:getgrav:grav:*:*:*:*:*:*:*:*
Vendors & Products Getgrav
Getgrav grav
References
Metrics cvssV3_1

{'score': 6.1, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N'}

cvssV4_0

{'score': 5.1, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N'}


cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-07-15T17:59:04.551Z

Reserved: 2026-07-09T14:06:14.017Z

Link: CVE-2026-61453

cve-icon Vulnrichment

Updated: 2026-07-15T17:58:59.908Z

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-07-31T04:00:15Z

Weaknesses
  • CWE-79

    Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')