CVE-2025-66297

8.8 HIGH

📋 TL;DR

This vulnerability allows authenticated users with admin panel access in Grav CMS to escalate privileges to full admin or execute arbitrary system commands by injecting malicious Twig expressions. It affects Grav CMS installations prior to version 1.8.0-beta.27 where users have page creation/edit permissions.

💻 Affected Systems

Products:
  • Grav CMS
Versions: All versions prior to 1.8.0-beta.27
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Requires authenticated user with admin panel access and page creation/edit permissions.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full system compromise via remote code execution leading to data theft, lateral movement, and complete control of the server.

🟠

Likely Case

Privilege escalation to admin followed by data manipulation, additional user creation, or installation of backdoors.

🟢

If Mitigated

Limited impact if proper access controls restrict admin panel access and page editing permissions.

🌐 Internet-Facing: HIGH
🏢 Internal Only: HIGH

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires authenticated access but is straightforward once access is obtained.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 1.8.0-beta.27

Vendor Advisory: https://github.com/getgrav/grav/security/advisories/GHSA-858q-77wx-hhx6

Restart Required: No

Instructions:

1. Backup your Grav installation and database. 2. Update Grav to version 1.8.0-beta.27 or later via the admin panel or manually. 3. Verify the update was successful.

🔧 Temporary Workarounds

Restrict Admin Panel Access

all

Limit access to the Grav admin panel to only trusted users who absolutely need it.

Disable Page Editing Permissions

all

Remove page creation and editing permissions from non-admin users.

🧯 If You Can't Patch

  • Implement strict access controls to limit admin panel access to essential personnel only.
  • Monitor logs for suspicious Twig processing or scheduler API activity.

🔍 How to Verify

Check if Vulnerable:

Check your Grav version in the admin panel or via the command line with 'bin/gpm version'.

Check Version:

bin/gpm version

Verify Fix Applied:

Confirm version is 1.8.0-beta.27 or higher using 'bin/gpm version' or admin panel.

📡 Detection & Monitoring

Log Indicators:

  • Unusual Twig processing in page frontmatter
  • Suspicious scheduler API calls
  • Unexpected privilege escalation events

Network Indicators:

  • Unusual admin panel activity from non-admin users
  • Scheduler API requests with malicious payloads

SIEM Query:

source="grav_logs" AND (event="twig_processing" OR event="scheduler_execution") AND user!="admin"

🔗 References

📤 Share & Export