{"uuid": "ec667a7e-8939-4ad4-920c-e684ca4e11b6", "vulnerability_lookup_origin": "1a89b78e-f703-45f3-bb86-59eb712668bd", "author": "9f56dd64-161d-43a6-b9c3-555944290a09", "vulnerability": "GHSA-8HGV-XC77-JMCR", "type": "seen", "source": "https://gist.github.com/alon710/4fa11a336fbb6ab77c0a78c465929e9e", "content": "# GHSA-8HGV-XC77-JMCR: GHSA-8HGV-XC77-JMCR: Privilege Escalation to Super-Admin via Twig Sandbox Escape and Stored XSS in Grav CMS Assets\n\n&gt; **CVSS Score:** 9.0\n&gt; **Published:** 2026-08-21\n&gt; **Full Report:** https://cvereports.com/reports/GHSA-8HGV-XC77-JMCR\n\n## Summary\nAn overly permissive default configuration in the Grav CMS Twig sandbox combined with a lack of neutralization of double-quote characters in the Asset rendering engine allows low-privileged page editors to inject malicious JavaScript into administrative contexts. This leads to a stored cross-site scripting (XSS) condition that compromises the sessions of super-administrators, facilitating complete privilege escalation.\n\n## TL;DR\nA privilege escalation vulnerability in Grav CMS allows page editors to execute arbitrary client-side script code in administrative contexts. By combining a permissive Twig sandbox allowlist with attribute breakout in asset rendering, attackers can steal JWT tokens or create rogue administrative accounts.\n\n## Exploit Status: POC\n\n## Technical Details\n\n- **CWE ID**: CWE-79\n- **Attack Vector**: Network (AV:N)\n- **CVSS v3.1 Score**: 9.0 (Critical)\n- **Exploit Maturity**: PoC (Proof of Concept)\n- **KEV Status**: Not Listed\n- **Affected Versions**: &lt; 2.0.20\n\n## Affected Systems\n\n- Grav CMS\n- **Grav CMS**: &lt; 2.0.20 (Fixed in: `2.0.20`)\n\n## Mitigation\n\n- Upgrade to Grav CMS version 2.0.20 or above.\n- Remove addjs and addcss from the Twig Sandbox allowlist in system/config/security.yaml or user/config/security.yaml.\n- Restrain page editing permissions to trusted users to reduce the attack surface.\n\n**Remediation Steps:**\n1. Check the running Grav version using the administrative dashboard or via the command-line utility: 'bin/gpm index'.\n2. If the version is prior to 2.0.20, initiate the update using 'bin/gpm selfupgrade'.\n3. Confirm that 'system/src/Grav/Common/Twig/Sandbox/SandboxDefaults.php' no longer allows 'addjs' or 'addcss' for the Assets class.\n4. Verify that the asset rendering output now uses the escapeAssetUrl function to encode double-quote characters.\n\n## References\n\n- [GitHub Security Advisory GHSA-8HGV-XC77-JMCR](https://github.com/advisories/GHSA-8HGV-XC77-JMCR)\n- [Official Patch Commit](https://github.com/getgrav/grav/commit/a4e8c4b748eb338ee7ab1dd26e7620a93bade047)\n- [Grav CMS Version 2.0.20 Release Notes](https://github.com/getgrav/grav/releases/tag/2.0.20)\n\n\n---\n*Generated by [CVEReports](https://cvereports.com/reports/GHSA-8HGV-XC77-JMCR) - Automated Vulnerability Intelligence*", "creation_timestamp": "2026-08-21T20:31:50.162582Z"}