External risk intelligence

Grav Twig Injection Vulnerability Allows Remote Code Execution

CVE advisorySeverity: CRITICAL (CVSS 9.3)

CVE-2026-130735

Grav is a content management system (CMS) typically deployed as a public-facing web application. Since the vulnerability involves user-supplied content such as image titles and file names being processed by the application, it is commonly exposed to the internet in standard web deployments.

Cross-site Scripting

Halo Surface Signal: 4 out of 5 — likely to be public-facing.

External exposure likelihood

Horizon Alert

Summary of the vulnerability and why it matters

This advisory details a critical vulnerability in Grav, a content management system, that could allow unauthorized code execution through specially crafted image metadata. Exploitation could lead to the delivery of malicious scripts to all site visitors or the exposure of sensitive, unpublished content. The main concern is confirming relevance and exposure.

  • Unsafe image details can run unauthorized code.
  • This impacts all users and content visibility.
  • Confirm if your Grav instances are affected.

Attack Path

How an attacker could exploit the issue

An attacker could leverage this vulnerability by uploading media with specially crafted titles, alt text, class names, IDs, or file names to a Grav CMS. This malicious input, when processed by the vulnerable Twig templating engine, allows for code injection. This injection could then be used to serve malicious scripts to all visitors or expose sensitive, unpublished content.

  • Anonymous uploaders can submit malicious input.
  • Input is processed by the Twig templating engine.
  • Exposes sensitive content and allows script injection.

Live Threat

Current exploitation, exposure, and threat context

The Grav CMS is vulnerable to Twig injection when users, including anonymous uploaders, can insert specific characters into media elements. This could allow an attacker to execute Twig code, potentially leading to script injection across pages or exposure of sensitive content.

  • Website content and user data.
  • Injecting code via image titles/filenames.
  • Execute scripts or expose unpublished content.

Operational Fix

Recommended remediation, mitigation, and detection steps

This critical vulnerability in Grav impacts systems where user-provided content, such as image titles and filenames, is processed. Application owners, infrastructure teams, and security teams should collaborate to identify all instances of Grav, assess their exposure and business criticality, and then prioritize remediation based on risk.

  • Application owners should own remediation efforts.
  • Verify all Grav instances and their reachability.
  • Plan for updates during the next maintenance window.

Supplementary metadata

Validate whether this threat affects your internet-facing exposure.

Halo Threat Intelligence helps prioritize remediation with Halo Surface Signal and H/A/L/O context. Start exposure validation with a free external attack surface trial.

Frequently asked questions

What is Grav, and how is it typically used?

Grav is a file-based content management system (CMS) that does not require a database, making it lightweight and fast for building websites. It uses the Twig templating engine to render pages and manage design layouts, often serving as the foundation for blogs, documentation sites, and small-to-medium web applications.

What does the Twig injection weakness mean in CVE-2026-130735?

This vulnerability is a form of code injection (CWE-79). It occurs when the application fails to properly filter user-supplied input, such as image filenames or metadata. Instead of treating this text as harmless content, the system processes it as executable Twig commands. This allows an attacker to manipulate how the CMS constructs pages, potentially enabling them to inject unauthorized scripts or reveal private data that should remain hidden from public view.

How is the Twig injection in CVE-2026-130735 triggered?

An attacker triggers this by including malicious Twig delimiters within common media fields, such as image titles, file names, or alt text. It is important to note that this does not require administrative access; the vulnerability can be triggered by media-only accounts or even anonymous users who have permission to upload files to the system. If the CMS processes these specific characters during page generation, the malicious code is executed.

Is my Grav instance at risk according to Halo Surface Signal?

Halo Surface Signal flags this as likely relevant for most Grav deployments because this CMS is almost always hosted as a public-facing web application. Since the vulnerability can be triggered by anonymous users via common input fields, any instance accessible over the internet faces a higher risk of exploitation compared to systems isolated on internal networks.

What is the first step to take for CVE-2026-130735?

The priority is to locate all Grav instances within your infrastructure and confirm their current versions. Once identified, evaluate which sites allow public or low-privileged file uploads, as these are the most immediate vectors for attack. You should then coordinate with your application teams to prioritize these systems for updates during your next maintenance window to move to a non-vulnerable version.

References