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

Medium 5.1 Published Updated

Page editors can inject malicious scripts via asset methods, leading to code execution and potential account takeover for all visitors including administrators.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
None listed

What is CVE-2026-86197?

CVE-2026-86197 is a medium-severity cross-site scripting vulnerability in getgrav grav, published on 5 Sep 2026. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.

Official description

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.

Weakness: CWE-79

Which versions are affected by CVE-2026-86197?

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

PackageAffectedFixed in
getgrav/grav PackagistAll versions2.0.20
getgrav/grav PackagistAll versions2.0.20

How do I fix CVE-2026-86197?

Upgrade getgrav/grav to 2.0.20 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-86197 being exploited?

There is no known exploitation of CVE-2026-86197 in the wild and no public exploit code.

Sources

Also known as GHSA-5pmv-xr2f-mrf8, GHSA-8hgv-xc77-jmcr.

Is CVE-2026-86197 in your software?

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

Check your SBOMs for free