Skip to main content

Grav CMS EUVDEUVD-2026-62542

| CVE-2026-62672 MEDIUM
Inefficient Regular Expression Complexity (ReDoS) (CWE-1333)
2026-08-19 GitHub_M GHSA-37f3-6p89-6qr9
6.0
CVSS 4.0 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Authenticate as low-privilege editor
  2. Delivery
    Craft catastrophically backtracking PCRE pattern
  3. Exploit
    Embed pattern in regex_replace Twig filter within page content
  4. Install
    Publish malicious page
  5. C2
    Visitor request triggers preg_replace execution
  6. Execute
    PHP worker CPU exhausted
  7. Impact
    Denial 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 security.twig_content.process_enabled setting must be enabled in system/config/security.yaml, which is a non-default configuration (AT:P in CVSS 4.0 reflects this specific deployment requirement). Exploitation is limited to availability impact only - no confidentiality or integrity compromise is possible through this vector. The attack is further constrained by the need to publish a page that site visitors will load, meaning the attacker must have publish rights in addition to edit rights. Default Grav installations with Twig content processing disabled are not exploitable.

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 security.twig_content.process_enabled configuration. The AC:H and AT:P designations are appropriate - the attack is not opportunistic against default installs. EPSS data was not provided; however, given the authentication and configuration prerequisites, widespread automated exploitation is unlikely. No KEV listing is confirmed, and no public proof-of-concept has been identified at time of analysis. Despite the moderate score, the impact on availability is rated High (VA:H) because a single malicious template publication can permanently degrade PHP-FPM worker capacity until the page is removed or the process recycled. The risk is most acute for multi-tenant Grav deployments or sites where editor accounts are broadly assigned - a scenario where the attacker pool expands significantly. Confidentiality and integrity are unaffected. Overall, this is a credible but targeted availability risk: lower priority than network-reachable unauthenticated vulnerabilities, but urgent for any deployment that grants Twig content processing to untrusted editors.

Exploit ScenarioDerived

An attacker who holds a low-privilege editor account on a Grav site with security.twig_content.process_enabled active crafts a Twig template containing a regex_replace call with a catastrophically backtracking pattern (e.g., a polynomial or exponential PCRE pattern applied to a sufficiently long input string) and publishes it as a page. When any visitor loads that page, the PHP-FPM worker executing preg_replace() spins to the PCRE backtrack limit, consuming 100% CPU for the duration, degrading or denying service to concurrent users. No public proof-of-concept has been identified at time of analysis, though constructing such a pattern requires only basic knowledge of ReDoS techniques.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

grav < 2.0.4

Affected Packages

composer getgrav/grav fix: 2.0.4
euvd grav fix: 2.0.4

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

Vendor (GitHub_M) PRIMARY 6.0 MEDIUM
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
vuln.today AI 5.3 MEDIUM

Network-delivered but requires authenticated editor and non-default Twig config (AC:H, PR:L); availability-only impact with no scope change.

3.1 AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:H/AT:P/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
High
Attack Requirements
Present
Privileges Required
Low
User Interaction
None
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

1
Patch available
Aug 19, 2026 - 16:17 EUVD

DescriptionCVE.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

EPSS Score
0.3%
Top 77% exploitable
Prevalence
Medium
popular open-source flat-file CMS, significant but not dominant market share
Exploit
POC
Public exploit code exists
Data Quality
6 sources
Confidence: High

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.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC Yes
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
Poc
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

50
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +30
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

More in Grav

View all
CVE-2025-66294 HIGH POC
8.7 Dec 01

Server-side template injection (SSTI) in Grav (getgrav/grav) prior to 1.8.0-beta.27 allows an authenticated attacker hol

CVE-2025-66301 HIGH POC
8.6 Dec 01

Broken access control in Grav CMS (CWE-285) before 1.8.0-beta.27 lets an authenticated editor-level user escalate their

CVE-2025-50286 HIGH POC
8.1 Aug 06

A Remote Code Execution (RCE) vulnerability in Grav CMS v1.7.48 allows an authenticated admin to upload a malicious plug

CVE-2024-34082 CRITICAL POC
9.9 May 15

Grav is a file-based Web platform. Rated critical severity (CVSS 9.9), this vulnerability is remotely exploitable, low a

CVE-2021-47812 CRITICAL POC
9.8 Jan 16

GravCMS 1.10.7 allows unauthenticated remote attackers to write arbitrary YAML configuration files, leading to full serv

CVE-2026-65008 CRITICAL POC
9.3 Jul 21

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

CVE-2026-75827 CRITICAL POC
9.3 Aug 18

Remote code execution in Grav CMS before 2.0.15 allows attackers holding page-edit or blueprint-config privileges to wri

CVE-2026-75837 CRITICAL POC
9.3 Aug 18

Vertical privilege escalation in Grav CMS before 2.0.14 lets a delegated administrator holding only the admin.users perm

CVE-2026-75828 CRITICAL POC
9.3 Aug 18

Stored cross-site scripting in Grav CMS before 2.0.15 lets authenticated editors smuggle JavaScript event handlers past

CVE-2025-66844 CRITICAL POC
9.1 Dec 15

Server-side request forgery (SSRF) in Grav CMS versions prior to 1.7.49.5 allows remote authenticated attackers to make

CVE-2025-66299 HIGH POC
8.8 Dec 01

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

CVE-2026-72819 HIGH POC
8.7 Aug 14

Remote code execution in Grav CMS before 2.0.13 allows authenticated low-privilege users to plant and execute arbitrary

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy