CVE-2026-130735: Grav 2.0.0 before 2.2.18 Twig Injection via Media Metadata and File Names
Grav from 2.0.0 before 2.2.18 contains a Twig injection vulnerability that allows media-only accounts and anonymous uploaders to execute Twig by placing delimiters in image titles, alt text, class, id, or file names. Attackers can combine injected Twig with the autoescape tag to serve script to every page visitor, including super admins, or expose unpublished page content.
Affected Software
Event History
Frequently Asked Questions
Who can exploit this vulnerability?
Media-only accounts can exploit it, and anonymous users can do so where anonymous uploads are enabled. An attacker does not need an authenticated account if anonymous uploading is available.
Which inputs should be treated as dangerous?
Image titles, alt text, class attributes, id attributes, and file names can carry Twig delimiters that trigger the injection. Media upload and metadata-editing workflows are therefore relevant exposure points.
What could an attacker achieve?
An attacker can execute Twig and can combine it with the autoescape tag to serve script to every page visitor, including super admins. The issue can also expose unpublished page content.
Are default installations affected?
The provided information identifies affected versions as Grav 2.0.0 before 2.2.18, but does not state whether anonymous uploads or media-only accounts are enabled by default. Exposure depends on whether attackers can upload media or control its metadata or file names.
How can I determine whether my instance is affected?
Check whether the Grav version is 2.0.0 through versions before 2.2.18, and review whether untrusted users can upload media or edit image metadata and file names. Inspect existing media titles, alt text, class, id, and filenames for Twig delimiter content.