On this page (8 sections)
A critical vulnerability, CVE-2026-130735, affects the Grav flat-file CMS. According to the GitHub Advisory Database entry, versions from 2.0.0 before 2.2.18 allow media-only accounts and anonymous uploaders to execute Twig by placing template delimiters in image titles, alt text, class, id or file names.
If you run Grav 2.x, especially with any form of public or low-privilege media upload, check your version now. The advisory was published on November 18, 2026, and the details below come from that single advisory record (the NVD entry repeats the same text), so some questions remain open.
At a glance
What happened
The advisory describes a Twig injection problem in Grav. Twig is the templating language Grav uses to build pages. Normally, text that a user supplies, such as an image caption, should be treated as plain data. Here, the advisory says that Twig delimiters placed in image titles, alt text, class, id or file names get executed as template code.
What makes it notable is who can trigger it. The advisory names two groups: accounts that only have media permissions, and anonymous uploaders. Those are low-trust sources, yet according to the advisory they can get Twig executed.
Technical details
As general background, server-side template injection happens when user-controlled input is evaluated as part of a template instead of being rendered as inert text. The attacker supplies a value that the template engine later interprets, rather than attacking the server directly.
Per the advisory, an attacker can combine injected Twig with the autoescape tag to serve script to every page visitor, including super admins, or to expose unpublished page content. The advisory does not explain the mechanism further. In general, Twig's autoescape feature controls how output is encoded, so misuse of it is a plausible route to unencoded script, but that is background and not a finding from the advisory.
The CVSS v4 metrics shown on the advisory are network attack vector, low attack complexity, no attack requirements, no privileges required and no user interaction, with high confidentiality, integrity and availability impact on the vulnerable system. The CWE listed is CWE-79 (cross-site scripting). The advisory text does not describe server-side command execution, so do not assume it from the name alone.
Who is affected
Any Grav site running a version from 2.0.0 before 2.2.18 falls in the affected range. Realistic exposure is highest in these cases:
- Sites that allow anonymous file or image uploads, for example through a form, gallery or community feature.
- Sites with accounts limited to media permissions, such as those given to outside helpers.
- Sites with unpublished pages or drafts that contain information you do not want public.
- Sites where super admins browse the front end while logged in, since the advisory says injected script can reach them.
A site with no upload path and no media-only accounts likely has a smaller attack surface, but the advisory does not say which sites can safely skip the update, so plan to move out of the affected range regardless.
How to check your exposure
- Find your Grav version. The admin panel usually shows the installed version, though the exact location can vary by setup. Compare it with the affected range, 2.0.0 up to but not including 2.2.18.
- List who can upload. Review user accounts and their permissions, and note any account limited to media access. Remove accounts you no longer need.
- Check for anonymous upload paths: forms with file fields, plugins that accept public uploads, and any custom code that writes into the media or pages folders.
- Look at existing media metadata and file names for template delimiters (curly braces with percent signs or double curly braces). These should not appear in captions, alt text, classes, ids or file names.
This read-only search, run from your Grav web root on a Linux server, lists files under the user folder whose names contain a curly brace. Any hit deserves a manual look, though legitimate files rarely have such names:
find user -name '*{*' -o -name '*}*'This read-only search looks for Twig-style delimiters inside page and metadata files. A match is not proof of compromise, but it tells you where to look:
grep -rnE '\{\{|\{%' user/pages --include='*.meta.yaml' --include='*.md'What to do now
The advisory does not confirm a patched version. The steps below combine what the advisory states with general hardening advice; the interim measures are not vendor-confirmed workarounds.
- Take a full backup of files and configuration.
- Check Grav's official channels for a fixed release. The description says the flaw ends before 2.2.18, so a release at 2.2.18 or later is the likely target, but confirm it before relying on it.
- Update to that confirmed release, ideally on a staging copy first.
- As general hardening until you can update, consider turning off anonymous uploads and public forms that accept files.
- Review media-only and other low-privilege accounts, remove unused ones and reset passwords where you are unsure.
- Inspect existing image titles, alt text, classes, ids and file names for Twig delimiters, and remove anything you did not put there.
- Treat unpublished page content as possibly exposed if uploads were open to anonymous users, and review it accordingly.
- Review pages for unexpected script tags or external script sources, and compare them with a known-good backup.
- If you find injected content, rotate admin passwords, sign out all sessions and follow your incident process.
Detection and monitoring afterwards
Since the advisory describes script served to every visitor, watch for changes you did not make. Review web server logs for upload requests from unfamiliar IP addresses and for new files in media folders. Keep an eye on which scripts load on your public pages.
A free security headers check can show whether your site sends a Content-Security-Policy header. A strict policy can limit the damage from injected script, although it is not a substitute for updating. Monitoring for header and content changes can also help you notice when something on a live page shifts unexpectedly. For broader guidance, see how to check if a website is hacked and what to do if your website is hacked.
What we do not know yet
The research gives limited detail. There is no confirmation of exploitation in the wild and no CISA Known Exploited Vulnerabilities listing in the record. The GitHub entry shows patched versions as unknown even though the description states the flaw ends before 2.2.18. Only one independent advisory is available, so details may be revised. Check Grav's official channels for the current fixed version before relying on specifics.
Sources
This article is based on the public sources below. Details can change as vendors and researchers publish more; check the original advisories before acting on version numbers.
