CVE-2026-61453 Grav before 2.0.1 XSS via Twig String Concatenation

Medium 5.1 Published Updated

Attackers with page-write permissions can execute arbitrary JavaScript in visitors' browsers by bypassing XSS validation via Twig string concatenation.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2026-61453?

CVE-2026-61453 is a medium-severity cross-site scripting vulnerability in getgrav grav, published on 15 Jul 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

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

Weakness: CWE-79

Which versions are affected by CVE-2026-61453?

2 open source packages ship an affected version, including getgrav/grav.

PackageAffectedFixed in
getgrav/grav PackagistFrom 2.0.02.0.1
getgrav/grav PackagistFrom 2.0.02.0.1

How do I fix CVE-2026-61453?

Upgrade getgrav/grav to 2.0.1 or later.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2026-61453 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-61453 exists.

Sources

Also known as CVE-2026-61710, GHSA-2c4f-86xc-cr74.

Is CVE-2026-61453 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free