Grav CMS API Blueprint Upload Privilege Escalation
A low-privileged authenticated API user with `api.media.write` can abuse `/api/v1/blueprint-upload` in Grav CMS to write an arbitrary YAML file into `user/accounts/`, enabling creation of a super-admin account and leading to full administrative compromise of the Grav API.
A vulnerability in Grav CMS version 2.0.0-beta.2 allows a low-privileged, authenticated API user to escalate privileges to a super administrator. This flaw resides in the /api/v1/blueprint-upload endpoint. By manipulating the destination and scope parameters, an attacker can write an arbitrary YAML file into the user/accounts/ directory. This circumvents intended access controls, allowing the creation of a new administrator account with api.super privileges. Exploitation requires only api.media.write access. Successful exploitation leads to complete control over the CMS management API, potentially enabling further attacks such as code execution. This vulnerability was disclosed on May 6, 2026, and poses a significant threat to Grav CMS installations using the API plugin.
Attack Chain
- Attacker authenticates to the Grav CMS API using a low-privileged account with
api.media.writepermissions. - The attacker crafts a malicious HTTP POST request to
/api/v1/blueprint-upload. - The request includes multipart form data with the
destinationparameter set toself@:and thescopeparameter set tousers/anything. - The request includes a
fileparameter containing a YAML file crafted to create a new admin user, including setting a plaintext password andapi.superaccess. - The Grav CMS API resolves the file path based on the
destinationandscopeparameters, writing the malicious YAML file to theuser/accounts/directory. - The attacker authenticates to the Grav CMS API using the newly created admin user credentials defined in the YAML file.
- The attacker successfully logs in as a super administrator, gaining full access to the Grav CMS management API.
- The attacker leverages their elevated privileges to modify content, alter configurations, manage users, or install malicious plugins/themes, ultimately achieving complete CMS compromise.
Impact
Successful exploitation grants an attacker full control over the Grav CMS instance. An attacker can modify website content, alter configurations, manage users (including creating additional administrator accounts), install or update plugins/themes, and access system-level administration features. This can lead to complete CMS compromise, potentially resulting in data theft, defacement, or further exploitation, such as server-side code execution. The vulnerability allows any user with limited API access (api.media.write) to create a super administrator account, drastically increasing the attack surface and potential for widespread damage.
Recommendation
- Upgrade Grav CMS to version
2.0.0-beta.4or later to patch the vulnerability as per the advisory (https://github.com/advisories/GHSA-6xx2-m8wv-756h). - Deploy the Sigma rule
Detect Grav CMS Malicious Blueprint Uploadto detect attempts to exploit this vulnerability by monitoring for suspicious blueprint uploads to theuser/accountsdirectory. - Implement the Sigma rule
Detect Grav CMS New Admin User Creation via APIto identify the creation of new admin users via the API endpoint. - Restrict
api.media.writepermissions to only trusted users, reducing the potential attack surface.
Detection coverage 2
Detect Grav CMS Malicious Blueprint Upload
highDetects attempts to upload malicious blueprints to the user/accounts directory in Grav CMS via the API, indicating potential privilege escalation.
Detect Grav CMS New Admin User Creation via API
mediumDetects the creation of a new admin user via the API endpoint, which could be a result of the blueprint upload vulnerability.
Detection queries are available on the platform. Get full rules →