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.