Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconAuthenticate as page editor
-
DeliveryEnable or confirm Twig content processing is active
-
ExploitCraft Twig template with malicious PCRE in regex_replace
-
InstallSubmit page content to Grav
-
C2preg_replace() enters catastrophic backtracking
-
ExecuteWeb server worker CPU exhausted
-
ImpactService unavailable
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V2 - Validation and Business Logic Regex complexity limits
MITRE ATT&CK
1 technique across 1 tactic: Impact The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Two conditions must both be true for exploitation: (1) The Grav security setting |
| Impact | The CVSS 4.0 score of 6.0 is fair and appropriately modulated by AT:P (attack requirements present), reflecting that the non-default Twig content processing setting must be enabled. The network attack vector and low privilege requirement mean exploitation is straightforward for anyone holding a page-editor account on an affected instance - no complex payload delivery or privilege escalation is needed beyond that baseline. EPSS data was not provided, but the gating conditions (non-default config + authenticated editor) substantially reduce the realistic exploitation population. No KEV listing and no known POC further suggest opportunistic mass exploitation is not occurring. The practical risk is highest for multi-tenant Grav installations - hosted CMS platforms or educational/agency environments - where untrusted users may hold page-editor roles and where Twig content processing has been intentionally enabled. Single-operator personal sites are lower risk by posture even if technically vulnerable. The CVSS vector is internally consistent with the description; no conflicting signals are present. |
| Exploit ScenarioDerived | An attacker with a page-editor account on a Grav instance where |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jul 17, 2026
ReDoS in Grav CMS's Twig sandbox allows an authenticated page editor to crash the web server process via a catastrophically backtracking PCRE pattern supplied to the regex_replace filter. Affected versions are all Grav releases prior to 2.0.4. Exploitation requires a non-default configuration (security.twig_content.process_enabled: true) and at least page-editor-level authentication, limiting blast radius to deployments that have deliberately unlocked Twig processing in page content. No public exploit code or CISA KEV listing has been identified at time of analysis.
RemediationAI
The primary fix is to upgrade Grav to version 2.0.4 or later, as confirmed by the vendor security advisory at https://github.com/getgrav/grav/security/advisories/GHSA-37f3-6p89-6qr9. If an immediate upgrade is not possible, the most effective compensating control is to ensure security.twig_content.process_enabled remains set to false (its default value) in the Grav configuration - this completely blocks the attack path by preventing user-supplied content from being processed as Twig templates. The trade-off is that any legitimate Twig templating in page content will cease to function. Additionally, administrators should audit whether any page-editor-role accounts belong to untrusted or external users, and if so, consider demoting them until the patch is applied. There is no known way to safely permit process_enabled: true without patching, since the underlying PCRE passthrough is the root cause.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 2 packages in composer, euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Grav (CPE: cpe:2.3:a:getgrav:grav:*:*:*:*:*:*:*:*) is a PHP-based flat-file CMS that uses Twig as its templating engine. The vulnerability stems from CWE-1333 (Inefficient Regular Expression Complexity): the regex_replace Twig filter and function are allowlisted inside Grav's Twig content sandbox and pass user-controlled PCRE patterns directly to PHP's native preg_replace(). PHP's PCRE engine uses recursive backtracking that, when given a pattern with ambiguous quantifiers on overlapping character classes, can degrade to exponential time complexity - consuming all available CPU before returning a result. Because preg_replace() executes synchronously within the PHP web worker process, a single crafted request is sufficient to block that worker indefinitely, effectively removing it from the server pool.
Know when Grav gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
Network vector with low-privilege authentication required; no confidentiality or integrity impact; high availability impact via CPU exhaustion of the web worker process.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
Lifecycle Timeline
1DescriptionCVE.org
Grav before 2.0.4 contains a regular expression denial of service (ReDoS) vulnerability in the regex_replace filter and function, which are allowlisted in the Twig content sandbox. When Twig processing in page content is enabled (security.twig_content.process_enabled: true, disabled by default), an authenticated page editor can supply a catastrophically backtracking PCRE pattern that is passed directly to PHP's preg_replace(), causing unbounded CPU consumption and denial of service to the web server process.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.
Related Vulnerabilities in Grav CMS Access Control and Injection Vulnerabilities
View all 4Server-side template injection (SSTI) in Grav (getgrav/grav) prior to 1.8.0-beta.27 allows an authenticated attacker hol
Broken access control in Grav CMS (CWE-285) before 1.8.0-beta.27 lets an authenticated editor-level user escalate their
A Remote Code Execution (RCE) vulnerability in Grav CMS v1.7.48 allows an authenticated admin to upload a malicious plug
Grav is a file-based Web platform. Rated critical severity (CVSS 9.9), this vulnerability is remotely exploitable, low a
GravCMS 1.10.7 allows unauthenticated remote attackers to write arbitrary YAML configuration files, leading to full serv
Remote code execution in Grav CMS 2.0.4 (fixed in 2.0.7) lets an authenticated user holding the admin.pages or api.pages
Remote code execution in Grav CMS before 2.0.15 allows attackers holding page-edit or blueprint-config privileges to wri
Vertical privilege escalation in Grav CMS before 2.0.14 lets a delegated administrator holding only the admin.users perm
Stored cross-site scripting in Grav CMS before 2.0.15 lets authenticated editors smuggle JavaScript event handlers past
Server-side request forgery (SSRF) in Grav CMS versions prior to 1.7.49.5 allows remote authenticated attackers to make
Grav is a file-based Web platform. Prior to 1.8.0-beta.27, Grav CMS is vulnerable to a Server-Side Template Injection (S
Remote code execution in Grav CMS before 2.0.13 allows authenticated low-privilege users to plant and execute arbitrary
EUVD-2026-45083
GHSA-6gqg-9qjp-56jm
NVD
CVE.org
EPSS
VulDB
Exploit-DB