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.
Published: 2026-09-05
Score: 5.1 Medium
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

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.

Generated by OpenCVE AI on September 5, 2026 at 13:20 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade Grav to version 2.0.20 or later to receive the fixed sandbox policy.
  • If an immediate upgrade is not possible, reconfigure the Twig sandbox or add custom filters to enforce escaping on addJs and addCss calls, preventing unescaped asset tags from being rendered.
  • Restrict the editor role so that only trusted users can register custom assets, or disable asset registration for unauthenticated or non‑admin users until the patch is applied.

Generated by OpenCVE AI on September 5, 2026 at 13:20 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Sat, 05 Sep 2026 12:30:00 +0000

Type Values Removed Values Added
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.
Title Grav before 2.0.20 Cross-Site Scripting via Assets Sandbox
First Time appeared Getgrav
Getgrav grav
Weaknesses CWE-79
CPEs cpe:2.3:a:getgrav:grav:*:*:*:*:*:*:*:*
Vendors & Products Getgrav
Getgrav grav
References
Metrics cvssV4_0

{'score': 5.1, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N'}


cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-09-05T12:09:10.147Z

Reserved: 2026-09-05T11:52:36.821Z

Link: CVE-2026-86197

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-09-05T13:18:15.110

Modified: 2026-09-05T13:18:15.110

Link: CVE-2026-86197

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-09-05T13:30:05Z

Weaknesses
  • CWE-79

    Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')