Description
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.
Published: 2026-08-19
Score: 6 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

Grav injects a user-controlled regular expression pattern into PHP’s preg_replace() function without further sanitization. The regex_replace filter and function are allowed in the system/config/security.yaml file, and the GravExtension::regexReplace() method passes the pattern directly to the regex engine. A malicious editor can craft a catastrophically backtracking pattern that consumes near‑total CPU resources, causing the PHP worker to stall and denying service to all site visitors. The weakness is a regex denial‑of‑service flaw classified as CWE‑1333.

Affected Systems

The issue affects all Grav releases prior to version 2.0.4, whenever the security.twig_content.process_enabled flag is true and the regex_replace filter is in the sandbox allowlist. Users who run a vulnerable Grav installation with administrative or page‑editor permissions must upgrade the core to 2.0.4 or later, or otherwise remove or restrict the regex_replace functionality in system/config/security.yaml.

Risk and Exploitability

The CVSS score of 6.0 indicates moderate severity. The EPSS score is < 1%, indicating a very low likelihood of exploitation, and the vulnerability is not listed in CISA’s KEV catalog. Exploitation requires an authenticated editor who can publish a Twig template. The attack vector is internal and privileged; the potential impact is full denial of service to all site visitors when the malformed pattern is processed.

Generated by OpenCVE AI on August 20, 2026 at 15:10 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Apply the official Grav 2.0.4 patch or later version to eliminate the vulnerable regex_replace implementation.
  • Remove or comment out the regex_replace entry from the system/config/security.yaml allowlist to prevent the filter from executing.
  • Set the security.twig_content.process_enabled flag to false if template processing is not required to avoid execution of potentially dangerous Twig templates.

Generated by OpenCVE AI on August 20, 2026 at 15:10 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-37f3-6p89-6qr9 Grav: Authenticated ReDoS via regex_replace in Twig Sandbox
History

Thu, 20 Aug 2026 15:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Wed, 19 Aug 2026 19:00:00 +0000

Type Values Removed Values Added
First Time appeared Getgrav
Getgrav grav
Vendors & Products Getgrav
Getgrav grav

Wed, 19 Aug 2026 16:00:00 +0000

Type Values Removed Values Added
Description 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.
Title Grav: Authenticated ReDoS via regex_replace in Twig Sandbox
Weaknesses CWE-1333
References
Metrics cvssV4_0

{'score': 6, 'vector': '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'}


cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-08-19T18:00:39.622Z

Reserved: 2026-07-14T20:22:04.394Z

Link: CVE-2026-62672

cve-icon Vulnrichment

Updated: 2026-08-19T18:00:18.248Z

cve-icon NVD

Status : Received

Published: 2026-08-19T16:18:20.000

Modified: 2026-08-19T18:16:54.123

Link: CVE-2026-62672

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-20T15:15:03Z

Weaknesses
  • CWE-1333

    Inefficient Regular Expression Complexity