CVE-2026-85604
Received Received - Intake

Remote Code Execution in Grav CMS via Twig Sort Filter

Vulnerability report for CVE-2026-85604, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-09-04

Last updated on: 2026-09-04

Assigner: VulnCheck

Description

Grav before 2.0.19 (affected versions <= 2.0.17) contains a remote code execution vulnerability in the Twig sort filter. The sortFunc wrapper in GravExtension.php hardcodes Twig's isSandboxed argument to false, so unlike |map/|filter/|reduce, |sort accepts a plain function name inside the sandbox; the remaining denylist misses spl_autoload, which performs a PHP include. An authenticated user with only page-write rights (admin.pages or api.pages.write) can supply a crafted payload (e.g., via form frontmatter rendered by the Email plugin) that invokes spl_autoload through the sort filter, resulting in arbitrary PHP execution as the web server user.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-09-04
Last Modified
2026-09-04
Generated
2026-09-04
AI Q&A
2026-09-04
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 2 associated CPEs
Vendor Product Version / Range
grav grav to 2.0.19 (exc)
getgrav grav to 2.0.19 (exc)

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-94 The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

CVE-2026-85604 is a remote code execution vulnerability in Grav CMS versions 2.0.17 and earlier. It occurs because the sort filter in Grav's Twig extension incorrectly allows plain function names (like spl_autoload) to bypass sandbox restrictions. An authenticated user with page-write rights can exploit this by injecting a payload into page frontmatter, which triggers arbitrary PHP code execution as the web server user when processed.

Detection Guidance

Check Grav CMS version with: grep -r 'version' /path/to/grav/vendor/composer/installed.json. If version <= 2.0.17, the system is vulnerable. Inspect Twig templates for unsanitized sort filter usage or unexpected function calls like spl_autoload in user-edited content.

Impact Analysis

This vulnerability allows an attacker with page-editing access to execute arbitrary PHP code on the server. This could lead to full system compromise, data theft, or unauthorized modifications. The attack does not require administrative privileges or file uploads, only the ability to edit pages.

Compliance Impact

This vulnerability could lead to unauthorized data access or exfiltration, violating GDPR's data protection requirements and HIPAA's security rules. Organizations using vulnerable Grav versions may face compliance violations, legal penalties, and reputational damage if exploited.

Mitigation Strategies

Upgrade Grav CMS to version 2.0.19 or later immediately. Review and restrict page-edit permissions to trusted users only. Audit all user-edited pages for suspicious payloads in form fields or frontmatter. Disable the Email plugin if not required or ensure it sanitizes inputs properly.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-85604. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart