Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessObtain media-only account or anonymous upload
-
DeliveryInject Twig into image title/filename metadata
-
ExploitTwig evaluated as page content on render
-
ExecutionEnable autoescape false to emit script
-
ImpactSuper admin views page, session hijacked
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK
2 techniques across 2 tactics: Initial Access, Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Three concrete paths, all against Grav 2.0.0-2.2.17 (page Twig is on by default for every page since 2.0.19): (1) an API account scoped to api.media.* only - no page rights - patches an image's title/alt/class/id via the metadata endpoint; (2) an anonymous visitor uploads via a public Form 'type: file' field stored in the page folder, when that page also renders another medium using ?link, ?lightbox, or ?display=thumbnail, so the attacker-controlled file name becomes the thumbnail src; (3) on sites with auto_metadata_exif enabled (OFF by default), anonymous use of the IPTC title. Limiting factors: serving executable script additionally requires a {% autoescape false %} tag; without it the injected Twig can still print protected/unpublished page content or force a 500 error. Allowed characters matter - Utils::checkFilename() blocks <, >, and " but permits {, }, %, |. So exploitation is not truly condition-free: it requires either a media-only account or a non-default page configuration combining public upload with a linked/thumbnailed medium. |
| Impact | Signals align toward genuine priority but with important nuance. The CVSS 4.0 base is 9.3 (Critical) with AV:N/AC:L/PR:N/UI:N and High VC/VI/VA, and the vuln.today decision label is act_now, reported by VulnCheck. However, the vendor advisory itself downgrades the real-world severity to High (not Critical) because exploitation of a default install needs EITHER a media-only API account (api.media.*) OR an anonymous public upload form on a page that also displays another medium with a link/lightbox/thumbnail option - conditions not universally present. This creates tension: the CVSS vector's PR:N/AC:L understates the configuration/account prerequisites the vendor documents, so the headline 9.3 overstates ease against an average deployment. No CISA KEV listing is present (not confirmed actively exploited) and no EPSS score is supplied, so widespread automated exploitation cannot be asserted. A detailed reproducer is published in the GHSA advisory. Net: a serious, patch-now issue for Grav operators - stored XSS/Twig injection that can escalate to super-admin session takeover - but the act_now urgency should be weighed against whether the deployment exposes a media-only account or an anonymous upload path, which the raw vector does not capture. |
| Exploit ScenarioDerived | An attacker holding only media rights (an api.media.* account with no page access), or an anonymous visitor uploading through a public form, writes Twig delimiters into an image's title, alt, class, id, or file name - for example a title of {% autoescape false %}<img src=x onerror=alert(document.domain)>{% endautoescape %}. Because that metadata-derived text is HTML-escaped but not Twig-protected, it is evaluated as page-content Twig when any visitor, including a signed-in super admin, loads a page that renders the image, enabling script execution and super-admin session hijack. A working reproducer is published in the GHSA advisory (a photodesk media-only account serving script on /about, a page the account cannot read or edit). |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Nov 18, 2026
Twig injection in Grav 2.0.0 through 2.2.17 lets an account holding only media permissions, or in narrower configurations an anonymous uploader, execute Twig that is embedded in image metadata (title, alt text, class, id) or in uploaded file names. Because that text is HTML-escaped but not Twig-escaped before it reaches Twig::processPage(), injected markup renders on any page displaying the image, so a media-only account can serve script to every visitor of a page it cannot read or edit, including a signed-in super admin, or expose protected and unpublished page content. Exploitation is not condition-free: running script additionally requires a {% autoescape false %} tag, and the anonymous path needs a public file upload form on a page that also renders another medium via ?link, ?lightbox or ?display=thumbnail (or the non-default auto_metadata_exif setting). The vuln.today decision label is act_now; no public exploit code or CISA KEV entry was identified at time of analysis.
RemediationAI
Upgrade Grav to 2.2.18 or later, which rebuilds Markdown image elements from the medium with any Twig opener written as an entity so sidecar- and filename-derived text stays text while the author's own image Twig still executes, and which drops the autoescape tag from the content sandbox defaults; upgrade the API plugin to 1.1.6 in the same change window so media metadata values containing {{, {% or {
are rejected at the API layer (file names are covered by the core fix). Fixed versions per branch: Grav 2.2.18 (composer getgrav/grav >= 2.2.18) and API plugin 1.1.6; the advisory is at https://github.com/getgrav/grav/security/advisories/GHSA-jc8q-6vcj-4x25. Where immediate upgrade is not possible, reduce the exposure paths the advisory identifies: remove or disable public Form type: file upload fields on pages, especially pages that also render another medium through ?link, ?lightbox or ?display=thumbnail (the trade-off is loss of public upload and thumbnail/lightbox functionality); stop rendering link/lightbox/thumbnail variants on pages that accept anonymous uploads, since without the thumbnail src path the attacker-controlled file name is not emitted (side effect: broken gallery views); keep auto_metadata_exif disabled, which is the default, to close the anonymous IPTC title vector (side effect: no automatic EXIF/IPTC metadata extraction); and restrict api.media.* accounts to trusted operators, noting this narrows but does not eliminate the privilege-escalation path from a legitimate media-only account, and injected Twig without {% autoescape false %} can still disclose protected or unpublished page content or force a 500 response. These are partial mitigations; the vendor-released 2.2.18 and 1.1.6 updates are the complete fix, and the act_now priority label reflects that they should be applied promptly.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The root cause spans CWE-79 (improper neutralization of input during web page generation) and CWE-1336 (improper neutralization of special elements used in a template engine). Grav's MediaObjectTrait::parsedownElement() builds image markup by pulling title, alt, class and id from the medium's metadata sidecar, while the medium URL places the raw file name into the src attribute. Parsedown escapes HTML metacharacters but leaves the Twig delimiters {{ and {% untouched, and Utils::checkFilename() rejects only <, > and " while accepting {, }, % and |. The placeholder mechanism that protects a page author's own Twig does not cover text derived from a medium, so sidecar- or filename-derived text reaches Twig::processPage() and is evaluated as template code. Page Twig processing is enabled by default for every page since Grav 2.0.19; before that only pages explicitly carrying process.twig: true were exposed. Script execution specifically requires the {% autoescape false %} tag to be reachable, which is why the fix both entity-encodes Twig openers in the Markdown image renderer and removes the autoescape tag from the content sandbox defaults. Grav 1.7 shares the metadata and file-name flow and has unsandboxed content Twig, so a 1.7 page that enables Twig, accepts public uploads and shows a thumbnail link could potentially give an anonymous uploader full Twig; that scenario has not been reproduced and is under separate evaluation.
Know when Grav gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
The confirmed reproducer uses a media-only account on default config (PR:L, AC:L); stored Twig/XSS crosses a privilege boundary to the super-admin session (S:C, C:H/I:H); no genuine availability impact beyond a page 500 (A:N).
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
Lifecycle Timeline
2DescriptionCVE.org
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.
Technical POC Analysis
CWE-79/CWE-1336: user-influenced media text is HTML-escaped but not Twig-escaped before Twig::processPage() evaluates it.
Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.
Executive ViewAI
CVE-2026-130735 is a critical Twig injection vulnerability in Grav (versions 2.0.0 through 2.2.17) that allows users with limited media permissions - or in some configurations, anonymous uploaders - to inject malicious scripts into image metadata or filenames. These scripts then execute on any page displaying the image, affecting all visitors, including administrators, and can lead to data exposure or session compromise. Leadership should prioritize this as it enables low-privileged users to compromise sensitive content and administrative sessions.
No vendor-released patch identified at time of analysis. Interim mitigations: restrict media permissions to trusted roles, disable public file upload forms, disable auto_metadata_exif, sanitize or escape Twig syntax in image metadata and filenames, and deploy a Web Application Firewall to block Twig expressions in uploads.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.
Server-side template injection (SSTI) in Grav (getgrav/grav) prior to 1.8.0-beta.27 allows an authenticated attacker hol
Broken access control in Grav CMS (CWE-285) before 1.8.0-beta.27 lets an authenticated editor-level user escalate their
A Remote Code Execution (RCE) vulnerability in Grav CMS v1.7.48 allows an authenticated admin to upload a malicious plug
Grav is a file-based Web platform. Rated critical severity (CVSS 9.9), this vulnerability is remotely exploitable, low a
GravCMS 1.10.7 allows unauthenticated remote attackers to write arbitrary YAML configuration files, leading to full serv
Remote code execution in Grav CMS 2.0.4 (fixed in 2.0.7) lets an authenticated user holding the admin.pages or api.pages
Remote code execution in Grav CMS before 2.0.15 allows attackers holding page-edit or blueprint-config privileges to wri
Vertical privilege escalation in Grav CMS before 2.0.14 lets a delegated administrator holding only the admin.users perm
Stored cross-site scripting in Grav CMS before 2.0.15 lets authenticated editors smuggle JavaScript event handlers past
Server-side request forgery (SSRF) in Grav CMS versions prior to 1.7.49.5 allows remote authenticated attackers to make
Grav is a file-based Web platform. Prior to 1.8.0-beta.27, Grav CMS is vulnerable to a Server-Side Template Injection (S
Remote code execution in Grav CMS before 2.0.13 allows authenticated low-privilege users to plant and execute arbitrary
EUVD-2026-128807
GHSA-mc27-cghq-x54v
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB