Grav CMS Code Injection and Privilege Escalation
2025-12-01
Grav is a file-based Web platform. Prior to 1.8.0-beta.27, when a user with privilege of user creation creates a new user through the Admin UI and supplies a username containing path traversal sequences (for example ..\Nijat or ../Nijat), Grav writes the account YAML file to an unintended path outside user/accounts/. The written YAML can contain account fields such as email, fullname, twofa_secret, and hashed_password. This vulnerability is fixed in 1.8.0-beta.27.
Grav is a file-based Web platform. Prior to 1.8.0-beta.27, a privilege escalation vulnerability exists in Grav’s Admin plugin due to the absence of username uniqueness validation when creating users. A user with the create user permission can create a new account using the same username as an existing administrator account, set a new password/email, and then log in as that administrator. This effectively allows privilege escalation from limited user-manager permissions to full administrator access. This vulnerability is fixed in 1.8.0-beta.27.
Grav is a file-based Web platform. Prior to 1.8.0-beta.27, Grav CMS is vulnerable to a Server-Side Template Injection (SSTI) that allows any authenticated user with editor permissions to execute arbitrary code on the remote server, bypassing the existing security sandbox. Since the security sandbox does not fully protect the Twig object, it is possible to interact with it (e.g., call methods, read/write attributes) through maliciously crafted Twig template directives injected into a web page. This allows an authenticated editor to add arbitrary functions to the Twig attribute system.twig.safe_filters, effectively bypassing the Grav CMS sandbox. This vulnerability is fixed in 1.8.0-beta.27.
Server-side template injection (SSTI) in Grav (getgrav/grav) prior to 1.8.0-beta.27 allows an authenticated attacker holding Grav editor (pages) permissions to break out of the Twig sandbox and execute arbitrary commands on the web server, escalating to full host compromise. The exploitable path requires the official Form and Admin plugins: an editor crafts or edits a form whose 'message' process action is passed to Twig's processString/cleanDangerousTwig, then uses nested function calls (for example through evaluate/evaluate_twig) to defeat the weak denylist regex; a narrower unauthenticated path exists only when a pre-existing form already feeds guest-supplied input through evaluate_twig. Publicly available exploit code exists, EPSS is elevated at 38.34% (97th percentile), and the flaw is fixed in 1.8.0-beta.27.
Broken access control in Grav CMS (CWE-285) before 1.8.0-beta.27 lets an authenticated editor-level user escalate their privileges by tampering with form processing logic. Because the /admin/pages/{page_name} endpoint fails to enforce authorization on critical fields, an attacker with only basic page-content permissions can intercept the save request and inject a crafted data[_json][header][form] value that rewrites the page's YAML frontmatter 'process' section - enabling redirect manipulation, arbitrary email sending, template changes, and potentially a Twig sandbox escape leading to code execution. Exploitation requires a valid low-privilege editor session plus the Admin and Form plugins with at least one form page; publicly available exploit code exists and EPSS rates this at 31.92% (97th percentile), though there is no confirmed active exploitation (CISA KEV). Fixed in 1.8.0-beta.27.
Grav is a file-based Web platform. Prior to 1.8.0-beta.27, A low privilege user account with page editing privilege can read any server files using "Frontmatter" form. This includes Grav user account files (/grav/user/accounts/*.yaml), which store hashed user password, 2FA secret, and the password reset token. This can allow an adversary to compromise any registered account by resetting a password for a user to get access to the password reset token from the file or by cracking the hashed password. This vulnerability is fixed in 1.8.0-beta.27.
Server-side template injection in Grav CMS (all releases prior to 1.8.0-beta.27, including the 1.7.x line such as 1.7.48) lets an unauthenticated remote attacker dump the site's full configuration - including plugin settings and any secrets they contain - by posting a crafted Twig expression in the __unique_form_id__ parameter of any form rendered by the Forms plugin. The affected code path evaluates attacker-supplied form field values as Twig, and the pre-patch version of Grav shipped no meaningful blocklist for dangerous Twig functions, so the response returns var_dumped configuration data directly to the requester. Impact is confidentiality-only (no integrity or availability effect per the independent assessment) and does not require authentication or user interaction, but a public, Forms-plugin-backed form must exist on the target; publicly available exploit code exists (no confirmed active exploitation / CISA KEV listing), and EPSS is low at roughly 0.06% (19th percentile).
Privilege escalation and authenticated remote code execution in Grav CMS versions prior to 1.8.0-beta.27 let an admin-panel user with page create/edit rights enable Twig processing in page frontmatter and inject expressions that reach the entire backend PHP object graph. Because the Twig sandbox is not enforced in the page-render context, a publisher or editor-level account can call grav.user.update()/save() to promote itself to admin/super-admin, or chain grav.scheduler.addCommand()/save()/run() to execute arbitrary system commands; publicly available exploit code exists, with a working payload published in the GHSA-858q-77wx-hhx6 advisory. The attack is access-gated rather than unauth-remote - it requires a valid authenticated account with admin.pages permission (CVSS vector PR:L), and the privilege-escalation path additionally requires the attacker to be logged into the front-end site with that same account. EPSS is low at 0.40% (60th percentile), consistent with a genuine but niche, insider-adjacent risk rather than mass exploitation.
Grav CMS before 1.8.0-beta.27 discloses bcrypt password hashes - including the administrator's - to an authenticated admin-panel account that has been granted read access to the user account management section, allowing those hashes to be read from the rendered profile page's source and cracked offline. The confirmed impact is a confidentiality loss, consistent with our assessment vector CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N; any actual privilege escalation is conditional on successfully cracking a bcrypt hash, which may be impractical against a strong admin password, and the exposure requires a non-default privileged read grant rather than anonymous access. Publicly available exploit code exists, EPSS is low (0.08%, ~23rd percentile), and there is no evidence of active exploitation; the vendor fixed the issue in 1.8.0-beta.27.
Grav is a file-based Web platform. Prior to 1.8.0-beta.27, A path traversal vulnerability has been identified in Grav CMS, allowing authenticated attackers with administrative privileges to read arbitrary files on the underlying server filesystem. This vulnerability arises due to insufficient input sanitization in the backup tool, where user-supplied paths are not properly restricted, enabling access to files outside the intended webroot directory. The impact of this vulnerability depends on the privileges of the user account running the application. This vulnerability is fixed in 1.8.0-beta.27.
Information disclosure in the Grav CMS Admin Panel affects every release prior to 1.8.0-beta.27, allowing any authenticated low-privilege (0-privilege) account to harvest other users' email addresses and account metadata, including those of the site administrator. An attacker requests another user's account page at /admin/accounts/users/{username} (for example /admin/accounts/users/admin) and, although the endpoint answers with HTTP 403 Forbidden, the target's email address is still interpolated into the <title> tag of the returned page body, so the blocked response leaks data anyway. Publicly available exploit code exists in the form of a published GHSA write-up and PoC video, but there is no confirmed active exploitation (not in CISA KEV) and EPSS is only 0.04% (13th percentile); the practical risk is targeted phishing, credential stuffing and social engineering rather than account takeover, as no read/write escalation, privilege gain or code execution is achievable.
Grav is a file-based Web platform. Prior to 1.8.0-beta.27, A Denial of Service (DoS) vulnerability has been identified in Grav related to the handling of scheduled_at parameters. Specifically, the application fails to properly sanitize input for cron expressions. By manipulating the scheduled_at parameter with a malicious input, such as a single quote, the application admin panel becomes non-functional, causing significant disruptions to administrative operations. The only way to recover from this issue is to manually access the host server and modify the backup.yaml file to correct the corrupted cron expression. This vulnerability is fixed in 1.8.0-beta.27.
Grav is a file-based Web platform. Prior to 1.8.0-beta.27, a Denial of Service (DoS) vulnerability was identified in the "Languages" submenu of the Grav admin configuration panel (/admin/config/system). Specifically, the Supported parameter fails to properly validate user input. If a malformed value is inserted-such as a single forward slash (/) or an XSS test string-it causes a fatal regular expression parsing error on the server. This leads to application-wide failure due to the use of the preg_match() function with an improperly constructed regular expression, resulting in an error. Once triggered, the site becomes completely unavailable to all users. This vulnerability is fixed in 1.8.0-beta.27.