Skip to main content
EPSS 0.9%top 42%

CVE-2026-85604: Improper Control of Generation of Code ('Code Injection') in getgrav grav

0
High
Published: 09/04/2026 (09/04/2026, 11:30:05 UTC)
Source: CVE Database V5
Vendor/Project: getgrav
Product: grav

Description

Grav versions before 2.0.18 contain a remote code execution vulnerability in the Twig sort filter. This flaw allows an authenticated user with page-write permissions to execute arbitrary PHP code via a crafted payload exploiting the sortFunc wrapper's improper sandboxing. The vulnerability arises because the isSandboxed argument is hardcoded to false, enabling the use of dangerous functions like spl_autoload within the sandbox.

CVSS v4.0

Score 8.7high

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vuln. Confidentiality
High
Vuln. Integrity
None
Vuln. Availability
None
Subsq. Confidentiality
None
Subsq. Integrity
None
Subsq. Availability
None
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N

Affected software

getgrav

grav

Affected versions
>=0 <2.0.18

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 09/15/2026, 00:59:01 UTC

Technical Analysis

CVE-2026-85604 is a remote code execution vulnerability affecting Grav CMS versions prior to 2.0.18. The issue lies in the Twig sort filter implementation, where the sortFunc wrapper in GravExtension.php sets the isSandboxed argument to false. This improper sandboxing allows the sort filter to accept plain function names, unlike other filters such as map, filter, or reduce. The denylist used to restrict dangerous functions misses spl_autoload, which can perform PHP includes. An authenticated user with page-write rights (admin.pages or api.pages.write) can supply a crafted payload, for example through form frontmatter rendered by the Email plugin, to invoke spl_autoload and achieve arbitrary PHP code execution as the web server user.

Potential Impact

An attacker with authenticated page-write permissions can execute arbitrary PHP code on the server hosting Grav CMS. This can lead to full compromise of the web server environment under the web server user context. The vulnerability is high severity with a CVSS 4.0 score of 8.7, indicating a network attack vector with low complexity and no required privileges beyond page-write access.

Mitigation Recommendations

A fix is available in Grav version 2.0.18. Users should upgrade to version 2.0.18 or later to remediate this vulnerability. Until patched, restrict page-write permissions to trusted users only and avoid exposing the Email plugin or other input vectors that render user-supplied frontmatter.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
VulnCheck
Date Reserved
2026-09-04T11:00:28.731Z
Cvss Version
4.0
State
PUBLISHED

Threat ID: 6a9aada3acd9273b4981da31

Added to database: 09/04/2026, 11:38:11 UTC

Last enriched: 09/15/2026, 00:59:01 UTC

Last updated: 10/17/2026, 18:48:23 UTC

Views: 45

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses