CVE-2026-61453

Grav before 2.0.1 XSS via Twig String Concatenation

Published Jul 15, 2026 CVSS 4.0 · 5.1 Medium EPSS < 1% KEV · Not listed
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.

Analysis

AI-generated

Technical 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.

Remediation

No solution or workaround provided in the CVE record.

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

Source ID Title
Github GHSA Github GHSA GHSA-2c4f-86xc-cr74 Grav: XSS Blueprint Validation Bypass via Twig String Concatenation
History
Type Values Removed Values Added
Metrics ssvc

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

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'}

Weaknesses
  • CWE-79

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

Sources

Status
PUBLISHED
Assigner
VulnCheck
Published
Updated
Oct 8, 2026, 3:23 PM
Reserved
Jul 9, 2026, 2:06 PM
Status
Deferred
Published
Jul 15, 2026, 12:18 PM
Modified
Oct 8, 2026, 4:17 PM