All vulnerabilities

Servers and applications

GHSA-fg8g-663r-f366

Modular pages skip the save-time Twig XSS check, letting a page editor store render-time-assembled stored XSS (incomplete fix for GHSA-2c4f-86xc-cr74)

Severity
High
Published
20 Aug 2026
Last changed
20 Aug 2026
Added to UpHeron
3 Nov 2026
Fixed in
2.0.18
Weakness
Cross-site scripting (CWE-79)Protection mechanism failure (CWE-693)
Sources
Project advisories (GitHub)

Description

Grav's save-time guard against render-time-assembled XSS in page content (Security::detectXssInEditorContent(), added for GHSA-2c4f-86xc-cr74) renders a page body through the sandboxed content-Twig pass and runs the XSS detector on the result, rejecting the save if a dangerous tag or event handler appears. It covers the blind spot of Validation::checkSafety(), which only inspects literal source and cannot see a handler assembled by Twig.

The save-time condition and the render-time condition disagreed. The render path (Page.php:943, PageContentTrait.php:692) computed ($content_twig_requested && $content_twig_allowed) || $this->modularTwig(), so modular pages execute body Twig unconditionally, ignoring the security.twig_content.process_enabled gate. The save path (Security.php:421) returned early unless the gate was on and the page requested Twig, with no modular branch.

From getgrav/grav's security advisory. Shortened; the full text is there.

Affected software

SoftwareAffected versions
GravServers and applications · github:getgrav/grav
  • From 2.0.0 before 2.0.18

About Grav

free software content management system written in PHP

From Wikidata, CC0 1.0.
Monthly downloads (Packagist)
1,748Packagist, 15 Nov 2026
Total downloads (Packagist)
92,444Packagist, 15 Nov 2026
GitHub stars
15,725GitHub, 15 Nov 2026
Forks
1,430GitHub, 15 Nov 2026
Latest release
2.2.29GitHub, 15 Nov 2026
Released
11 Nov 2026GitHub
License
MIT LicenseWikidata
Written in
PHPWikidata
First published on GitHub
2 Aug 2014GitHub

References