CVE-2026-86197: Grav before 2.0.20 Cross-Site Scripting via Assets Sandbox

Published Sep 5, 2026
·
Updated

Grav before 2.0.20 contains a cross-site scripting vulnerability in the Twig sandbox policy that allowlists addJs and addCss methods on Grav\Common\Assets without proper output escaping. Page editors can inject arbitrary script by registering malicious assets or injecting attributes, which are rendered unescaped into document head tags and executed for all visitors including administrators.

Affected Software

1 affected component
Grav Grav<2.0.20

Event History

Sep 5, 2026
CVE Published
via MITRE·12:09 PM
Data Sourced
via MITRE·12:09 PM
DescriptionWeakness

Frequently Asked Questions

1

Who can exploit this issue?

A page editor who can supply Twig content that uses the sandboxed asset methods can exploit it. The injected script executes in the browsers of visitors to the affected page, including administrators.

2

What versions are affected?

Grav versions before 2.0.20 are affected. The provided information does not identify any other affected products or configurations.

3

What does an attacker need to do to trigger the XSS?

The attacker needs page-editor access and the ability to register malicious JavaScript or CSS assets, or inject attributes through the allowlisted addJs or addCss methods. Those values are rendered without proper escaping in document head tags.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203