Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconAuthenticate as low-privilege editor
-
DeliveryCraft catastrophically backtracking PCRE pattern
-
ExploitEmbed pattern in regex_replace Twig filter within page content
-
InstallPublish malicious page
-
C2Visitor request triggers preg_replace execution
-
ExecutePHP worker CPU exhausted
-
ImpactDenial of service to site visitors
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 | Exploitation requires two concrete prerequisites: (1) the attacker must hold an authenticated page-editor account on the target Grav instance - PR:L in the CVSS vector confirms low-privilege authentication is required; (2) the |
| Impact | The CVSS 4.0 score of 6.0 with vector AV:N/AC:H/AT:P/PR:L reflects a genuinely constrained attack surface: exploitation requires both authenticated low-privilege editor access and the non-default |
| Exploit ScenarioDerived | An attacker who holds a low-privilege editor account on a Grav site with |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Aug 19, 2026
Regex-driven denial of service in Grav CMS prior to 2.0.4 allows authenticated page editors to exhaust PHP worker CPU by injecting catastrophically backtracking regular expression patterns through the allowlisted regex_replace Twig filter. The vulnerable path exists in GravExtension::regexReplace(), which forwards editor-supplied patterns directly to preg_replace() without backtrack-limit enforcement or error recovery. No public exploit or CISA KEV listing is confirmed at time of analysis, but the attack is straightforward for any user who holds page-editor privileges on an affected instance with Twig content processing enabled.
RemediationAI
Upgrade to Grav 2.0.4 or later, which is available at https://github.com/getgrav/grav/releases/tag/2.0.4. This release introduces safe error handling in GravExtension::regexReplace() so that a backtracking or otherwise invalid pattern returns the original subject rather than spinning the PHP worker. If an immediate upgrade is not feasible, set security.twig_content.process_enabled: false in system/config/security.yaml to disable Twig content processing entirely - this eliminates the attack surface but will break any legitimate use of Twig filters (including regex_replace) in page content, potentially affecting site functionality. A narrower compensating control is to audit and restrict which user roles are granted page-editor permissions, limiting the pool of principals who can publish Twig templates. The vendor advisory is at https://github.com/getgrav/grav/security/advisories/GHSA-37f3-6p89-6qr9.
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 is a flat-file PHP CMS that uses the Twig templating engine. The regex_replace filter and function are explicitly allowlisted in system/config/security.yaml, meaning Grav's security model intentionally exposes them to content editors. The vulnerable code path is GravExtension::regexReplace() in system/src/Grav/Common/Twig/Extension/GravExtension.php, which calls PHP's preg_replace() with a caller-supplied pattern. PHP's PCRE engine enforces a backtrack limit (pcre.backtrack_limit, default 1,000,000), but a sufficiently pathological pattern - such as /(a+)+$/ applied to a long non-matching string - can consume the entire limit and cause the worker process to spin at 100% CPU before returning NULL. CWE-1333 (Inefficient Regular Expression Complexity, ReDoS) is the root cause class. The CPE cpe:2.3:a:getgrav:grav:*:*:*:*:*:*:*:* covers all Grav versions prior to 2.0.4. The fix (commit 907116268ad4) wraps preg_replace() in an error-checking guard: if the call returns NULL and preg_last_error() is non-zero, the function returns the original subject unchanged, neutralizing the backtracking attack.
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:H/AT:P/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
Network-delivered but requires authenticated editor and non-default Twig config (AC:H, PR:L); availability-only impact with no scope change.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
1DescriptionCVE.org
Grav is a file-based Web platform. Prior to 2.0.4, Grav allowlists the regex_replace filter and function in system/config/security.yaml, and GravExtension::regexReplace() passes an editor-controlled pattern directly to preg_replace(). When security.twig_content.process_enabled is enabled, an authenticated page editor can publish a catastrophically backtracking pattern that consumes PHP worker CPU and denies service to site visitors. This issue is fixed in version 2.0.4.
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.
Server-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-62542
GHSA-37f3-6p89-6qr9
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB