Skip to main content

Duplicate Advisory: Grav: XSS Blueprint Validation Bypass via Twig String Concatenation

0
Medium
Published: 07/15/2026 (07/15/2026, 12:32:04 UTC)
Source: GCVE Database
Product: getgrav/grav

Description

Grav version 2.0.0 contains a cross-site scripting (XSS) vulnerability related to its blueprint validation process. The vulnerability arises when Twig content processing is enabled, allowing an attacker with page-write API permissions to bypass the XSS validator by using Twig string concatenation to construct malicious event handlers or tags dynamically. This results in arbitrary JavaScript execution in visitors' browsers. The issue was fixed in version 2.0.1.

CVSS v3.1

Score 6.1medium

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
None
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

Affected software

Packagistghsa
getgrav/grav
Affected versions
=2.0.0

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 09/17/2026, 02:03:58 UTC

Technical Analysis

The vulnerability in Grav v2.0.0 involves the XSS blueprint validator (Security::detectXss()) which inspects raw page content before Twig processing. When Twig content processing is enabled (twig_content.process_enabled: true), an attacker with page-write API permission can exploit Twig's string concatenation operator (~) to dynamically create event handler names, dangerous tags, or protocols at render time. The validator only sees the Twig expressions, which appear harmless, but after rendering, the output includes active payloads such as <img src=1 onerror=alert(1)>, enabling arbitrary JavaScript execution in users' browsers. This vulnerability is classified under CWE-79 and has a CVSS 3.1 score of 6.1 (medium severity).

Potential Impact

Successful exploitation allows an attacker with page-write API permissions to inject malicious JavaScript that executes in the browsers of site visitors, potentially leading to session hijacking, defacement, or other client-side attacks. The vulnerability affects confidentiality and integrity with limited impact on availability.

Mitigation Recommendations

An official fix is available in Grav version 2.0.1. Users should upgrade from version 2.0.0 to 2.0.1 or later to remediate this vulnerability. No other mitigations are indicated by the vendor advisory.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
GHSA-373m-p57p-8665
Osv Schema Version
1.4.0
Ecosystems
["Packagist"]
Database Specific Severity
MODERATE
Cvss Version
3.1

Threat ID: 6aab494a55bf5e2cf599045b

Added to database: 09/17/2026, 01:58:34 UTC

Last enriched: 09/17/2026, 02:03:58 UTC

Last updated: 09/17/2026, 02:03:58 UTC

Views: 2

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses