Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2025-66294: CWE-94: Improper Control of Generation of Code ('Code Injection') in getgrav grav

0
High
VulnerabilityCVE-2025-66294cvecve-2025-66294cwe-94cwe-1336
Published: Mon Dec 01 2025 (12/01/2025, 20:52:08 UTC)
Source: CVE Database V5
Vendor/Project: getgrav
Product: grav

Description

Grav is a file-based Web platform. Prior to 1.8.0-beta.27, a Server-Side Template Injection (SSTI) vulnerability exists in Grav that allows authenticated attackers with editor permissions to execute arbitrary commands on the server and, under certain conditions, may also be exploited by unauthenticated attackers. This vulnerability stems from weak regex validation in the cleanDangerousTwig method. This vulnerability is fixed in 1.8.0-beta.27.

AI-Powered Analysis

AILast updated: 12/08/2025, 22:16:21 UTC

Technical Analysis

CVE-2025-66294 is a critical Server-Side Template Injection (SSTI) vulnerability affecting Grav, a popular file-based web content management system. The vulnerability exists in versions prior to 1.8.0-beta.27 and arises from insufficient sanitization in the cleanDangerousTwig method, which uses weak regular expressions to filter dangerous Twig template syntax. This flaw enables attackers with editor-level authentication to inject and execute arbitrary code on the server, potentially leading to full system compromise. Under specific conditions, unauthenticated attackers may also exploit this vulnerability, increasing its threat surface. SSTI vulnerabilities allow malicious template code execution, which can bypass traditional input validation and lead to remote code execution (RCE). The CVSS 4.0 vector indicates network attack vector (AV:N), low attack complexity (AC:L), no user interaction (UI:N), and privileges required (PR:L), with high impact on confidentiality, integrity, and availability (VC:H/VI:H/VA:H). Although no exploits are publicly known yet, the severity and ease of exploitation make this a critical risk for Grav users. The vulnerability was publicly disclosed on December 1, 2025, and fixed in version 1.8.0-beta.27. Grav is widely used in Europe for lightweight CMS deployments, making this vulnerability relevant to many organizations. The weakness in regex validation highlights the importance of robust input sanitization in template engines. Attackers exploiting this flaw can execute arbitrary commands, access sensitive data, modify content, or disrupt services, severely impacting affected organizations.

Potential Impact

For European organizations, this vulnerability poses a significant risk, especially for those relying on Grav CMS for public-facing websites, intranets, or e-commerce platforms. Successful exploitation can lead to unauthorized code execution, resulting in data breaches, defacement, service disruption, or full server takeover. This compromises the confidentiality, integrity, and availability of organizational data and services. Given the high CVSS score and potential for unauthenticated exploitation under certain conditions, attackers could leverage this vulnerability to pivot within networks or launch further attacks. Organizations in sectors such as government, finance, healthcare, and media, which often use CMS platforms and handle sensitive data, are particularly vulnerable. The file-based nature of Grav means that compromised servers could also be used to distribute malware or conduct phishing campaigns. Additionally, the lack of known exploits currently suggests a window of opportunity for defenders to patch and harden systems before widespread attacks occur. Failure to address this vulnerability promptly could lead to regulatory compliance issues under GDPR due to potential data breaches.

Mitigation Recommendations

1. Upgrade Grav CMS installations immediately to version 1.8.0-beta.27 or later where the vulnerability is patched. 2. Restrict editor permissions strictly to trusted users and review user roles regularly to minimize the risk of insider exploitation. 3. Implement Web Application Firewalls (WAFs) with rules specifically designed to detect and block SSTI payloads and suspicious template syntax. 4. Conduct regular security audits and code reviews focusing on template usage and input sanitization mechanisms. 5. Monitor server logs and application behavior for unusual template rendering activities or command execution attempts. 6. Employ network segmentation to isolate CMS servers from critical backend systems to limit lateral movement in case of compromise. 7. Educate developers and administrators about secure template handling and the risks of SSTI vulnerabilities. 8. Consider deploying runtime application self-protection (RASP) solutions that can detect and prevent code injection at runtime. 9. Backup Grav CMS data and configurations regularly to enable rapid recovery if exploitation occurs. 10. Stay informed about updates from the Grav project and security advisories for any further patches or mitigations.

Need more detailed analysis?Upgrade to Pro Console

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2025-11-26T23:11:46.393Z
Cvss Version
4.0
State
PUBLISHED

Threat ID: 692e048c3937fa579fd29254

Added to database: 12/1/2025, 9:11:40 PM

Last enriched: 12/8/2025, 10:16:21 PM

Last updated: 1/16/2026, 3:09:32 AM

Views: 76

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 in Console -> Billing for AI refresh and higher limits.

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

Latest Threats