CVE-2026-61453: Grav before 2.0.1 XSS via Twig String Concatenation
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 (twigcontent.processenabled: 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.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Gravto a version that resolves this vulnerability.Fixed in 2.0.1 - Configuration
Disable Twig content processing by setting twig_content.process_enabled to false to prevent Twig string concatenation from dynamically constructing XSS payloads at render time.
Grav twig_content.process_enabled twig_content.process_enabled = false
Event History
Frequently Asked Questions
What is the severity of CVE-2026-61453?
The severity of CVE-2026-61453 is medium, with a score of 5.1.
What vulnerability does CVE-2026-61453 address?
CVE-2026-61453 addresses a cross-site scripting (XSS) vulnerability in Grav before version 2.0.1.
How do I fix CVE-2026-61453?
To fix CVE-2026-61453, upgrade Grav to version 2.0.1 or later.
What version of Grav is affected by CVE-2026-61453?
Grav versions prior to 2.0.1 are affected by CVE-2026-61453.
Who can exploit CVE-2026-61453?
An attacker with page-write API permission can exploit CVE-2026-61453 to execute XSS attacks.