{"items":[{"id":"NVI-00002504","kind":"vulnerability","title":"Grav: Authenticated ReDoS via regex_replace in Twig Sandbox","revision":1,"unknowns":["Customer inventory, deployment, reachability and exploitation have not been inspected."],"lifecycle":"active","identifiers":["GHSA-37f3-6p89-6qr9"],"plain_summary":"OSV carries this publisher advisory for getgrav/grav. This is an aggregated source copy; consult the original publisher and compare update dates.","review_status":"source_listed","control_topics":[],"public_actions":[{"summary":"The original advisory lists fixed boundaries 2.0.4 for getgrav/grav. Confirm the publisher’s latest guidance.","source_ids":["sr-1b6d79cec838231134a12e756691e206"],"action_type":"vendor_patch","limitations":"Confirm current vendor support, compatibility and deployment evidence. This report has not tested a fix in your system.","current_supported_target":null}],"schema_version":"1.1.0","source_metrics":[],"why_it_matters":"Published affected context helps an owner decide what evidence to gather. This report has not examined your application.","related_sources":[{"id":"sr-1b6d79cec838231134a12e756691e206","url":"https://github.com/advisories/GHSA-37f3-6p89-6qr9","basis":"vendor_advisory","notes":"GitHub-origin advisory, CC-BY-4.0; OSV is an aggregate copy, not independent corroboration.","title":"GHSA-37f3-6p89-6qr9","publisher":"GitHub Advisory Database via OSV","observed_at":"2026-10-31T21:41:49.652Z"}],"affected_context":[{"certainty":"source_listed","source_ids":["sr-1b6d79cec838231134a12e756691e206"],"technology":"getgrav/grav","known_exclusions":[],"conditions_summary":"### Summary\n\nThe `regex_replace` filter and function are allowlisted in Grav's Twig content sandbox. When Twig processing in page content is enabled `security.twig_content.process_enabled: true`, authenticated page editors can supply a catastrophically backtracking PCRE pattern, causing unbounded CPU consumption and denying service to the entire web server process.\n\n---\n\n### Details\n\nThe Twig sandbox allowlists, defined in `system/config/security.yaml`, explicitly include `regex_replace` in both the filter and function permission lists:\n\n**Source: `system/config/security.yaml`**\n\n```yaml\ntwig_sandbox:\n  allowed_filters:\n    # ...\n    - regex_replace    #  user-controlled pattern allowed in sandbox\n  allowed_functions:\n    # ...\n    - regex_replace    #  same\n```\n\nThe underlying implementation passes the caller-controlled `$pattern` directly into PHP's `preg_replace()` without any pattern complexity validation:\n\n**Source: `system/src/Grav/Common/Twig/Extension/GravExtension.php:1317-1319`**\n\n```php\npublic function regexReplace($subject, $pattern, $replace, $limit = -1)\n{\n    return preg_replace($pattern, $replace, $subject, $limit);\n}\n```\n\nWhen `twig_content.process_enabled` is `tru","public_affected_ranges":["ECOSYSTEM: introduced 0; fixed 2.0.4"]}],"null_published_at":"2026-10-31T22:00:33.892Z","source_updated_at":"2026-09-17T16:45:06.372Z","source_disclosed_at":"2026-09-02T14:50:57.000Z","is_synthetic_fixture":false,"null_last_reviewed_at":null,"public_change_summary":"First indexed by Null; source disclosure date is shown separately.","null_first_observed_at":"2026-10-31T21:41:49.652Z"}],"next_cursor":null,"snapshot_revision":"42594"}