CVE-2026-62672: Grav: Authenticated ReDoS via regex_replace in Twig Sandbox

Published Aug 19, 2026
·
Updated

Grav is a file-based Web platform. Prior to 2.0.4, Grav allowlists the regexreplace filter and function in system/config/security.yaml, and GravExtension::regexReplace() passes an editor-controlled pattern directly to pregreplace(). When security.twigcontent.processenabled 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.

Affected Software

1 affected component
Grav Grav<2.0.4

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade grav to a version that resolves this vulnerability.

    Fixed in 2.0.4
  2. Configuration

    Disable Twig content processing (set security.twig_content.process_enabled to disabled) to prevent an authenticated editor from publishing a catastrophically backtracking regex pattern that can trigger ReDoS via regex_replace.

    Grav Twig Sandbox (security.twig_content) security.twig_content.process_enabled = disabled

Event History

Aug 19, 2026
CVE Published
via MITRE·03:44 PM
Data Sourced
via MITRE·03:44 PM
DescriptionWeakness

Frequently Asked Questions

1

Who can exploit this issue?

An authenticated page editor can exploit it, but only when security.twig_content.process_enabled is enabled. The attacker can publish a Twig pattern designed to cause catastrophic regex backtracking.

2

Are default installations affected?

The issue depends on security.twig_content.process_enabled being enabled. The provided information does not state whether that setting is enabled by default.

3

What is the impact of successful exploitation?

A malicious pattern can consume PHP worker CPU, denying service to site visitors.

4

What should be done if an immediate upgrade is not possible?

Disable security.twig_content.process_enabled to prevent editor-controlled Twig content from reaching the vulnerable regex processing path. Restricting page-editor access also limits who can publish an exploit pattern.

5

Which version fixes the issue?

Grav 2.0.4 fixes this issue; versions prior to 2.0.4 are affected under the stated configuration.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203