---
id: CVE-2026-86197
title: >-
  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
summary: >-
  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
  regist…
severity: medium
cvss: 5.1
cvssVector: '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'
cwe:
  - CWE-79
vendor: getgrav
product: grav
affected:
  - grav < 2.0.20
published: '2026-09-05'
updated: '2026-09-10'
sourceUpdated: '2026-09-10T16:18:02.173'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2026-86197'
references:
  - url: 'https://github.com/getgrav/grav/security/advisories/GHSA-8hgv-xc77-jmcr'
    label: disclosure@vulncheck.com
  - url: >-
      https://www.vulncheck.com/advisories/grav-before-2.0.20-cross-site-scripting-via-assets-sandbox
    label: disclosure@vulncheck.com
tags:
  - nvd
  - cve.org
ssvc:
  exploitation: none
  automatable: 'no'
  technicalImpact: partial
  timestamp: '2026-09-10T14:19:06.496617Z'
cvssSource: cna
epss: 0.00412
epssPercentile: 0.32637
ingestedAt: '2026-09-06T10:53:51.640Z'
---

## Overview

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.

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.
