CVE-2026-86197
Received Received - Intake

Cross-Site Scripting in Grav CMS via Twig Sandbox Policy

Vulnerability report for CVE-2026-86197, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-09-05

Last updated on: 2026-09-05

Assigner: VulnCheck

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.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-09-05
Last Modified
2026-09-05
Generated
2026-09-05
AI Q&A
2026-09-05
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 2 associated CPEs
Vendor Product Version / Range
getgrav grav to 2.0.20 (exc)
grav grav to 2.0.20 (exc)

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-79 The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

Grav before 2.0.20 has a cross-site scripting (XSS) vulnerability in its Twig sandbox policy. The sandbox allowlists the addJs and addCss methods in the Assets service without proper output escaping. Page editors can exploit this to inject malicious scripts or CSS by registering harmful assets or injecting attributes. These are rendered unescaped in the document head tags and execute for all visitors, including administrators.

Detection Guidance

Check Grav version with 'bin/grav version' or in admin panel. Inspect page source for unescaped script/link tags in head. Review assets.addJs and assets.addCss method usage in templates or plugins. Look for unexpected JavaScript or CSS in page content.

Impact Analysis

An attacker with page editor privileges could inject malicious scripts that execute in the browsers of all visitors, including administrators. This could lead to privilege escalation, session hijacking, or unauthorized access to sensitive data. Attackers might also deface pages or spread malware to users.

Compliance Impact

This vulnerability could lead to unauthorized access to personal or sensitive data, violating GDPR and HIPAA requirements for data protection. If exploited, it may result in data breaches, triggering compliance violations, legal penalties, and reputational damage.

Mitigation Strategies

Upgrade Grav to version 2.0.20 or later. Temporarily disable addJs and addCss in security.yaml by setting 'assets.addJs: false' and 'assets.addCss: false'. Remove untrusted user access to page editing. Monitor for suspicious asset registrations.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-86197. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart