Impact
Grav before version 2.0.20 contains a cross‑site scripting flaw in the Twig sandbox policy. The policy allows the addJs and addCss methods on Grav\Common\Assets to be called without proper output escaping. A page editor can register malicious assets or inject crafted attributes, which are then rendered unescaped into the document head and executed by all site visitors, including administrators. This flaw can be used to run arbitrary client‑side code that could deface the page, exfiltrate information, or perform session hijacking. The weakness is identified as CWE‑79.
Affected Systems
Any Grav installation running a version earlier than 2.0.20 is affected. Users deploying Grav 2.0.19 or older should review their deployments for potential misuse of custom assets through the page editor interface. The vulnerability is tied to the Grav CMS deliverable produced by getgrav.
Risk and Exploitability
The CVSS score of 5.1 indicates moderate risk, and the EPSS is not available, so the likelihood of exploitation is uncertain but potentially low. The attacker must first gain editor privileges or exploit a mechanism that allows asset registration. Once the malicious asset is registered, the script runs in the context of all page visitors, posing a significant threat to confidentiality and integrity for an authenticated administrator and all end users. The vulnerability is not currently listed in CISA KEV, suggesting no known mass exploitation yet.
OpenCVE Enrichment