/

CVE-2026-65897

Severity:

HIGH RISK

(8.8)

Privilege Escalation (CWE-269) in Grav API Plugin

CVE-2026-65897

Deferred

Vulnerability type

Category:

Privilege Escalation

CWE:

CWE-269

Impact:

Unauthorized Privilege Elevation to Super Admin

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A privilege escalation flaw in the Grav API Plugin allows authenticated callers of api.users.write to create invitations that assign new users to highly privileged groups without proper validation.

When these invitations are accepted, the resulting accounts can gain super-admin API permissions even if the inviter never had such rights, undermining the intended access control model.

Affected context

This issue arises in deployments using the Grav API Plugin with versions prior to 1.0.10, specifically where invitations are used to onboard new accounts via the API.

The vulnerability exists in the invitation creation flow, where the groups field submitted by an authenticated caller is not adequately validated against the caller's own permissions or a trusted policy.

Environments that expose api.users.write to operational tooling, internal services, or lower-privileged administrators are particularly affected, because those actors can indirectly bootstrap accounts with super-admin API capabilities.

Exploit preconditions

  • Attack surface: Grav API endpoint handling user invitations (InvitationsController::create()).
  • Required access: Valid, authenticated API client with api.users.write capability; no super-admin privileges are required.
  • Trigger point: Submission of a crafted invitation payload that includes a groups field referencing roles or groups mapped to api.super or equivalent super-admin permissions.
  • Why exploitation is possible: The server trusts the groups field in the invitation request without constraining it to the inviter's permissible roles or enforcing a central policy, allowing privilege assignments beyond the caller's own authority.

Why this happens

The root cause maps to CWE-269: Improper Privilege Management.

The invitation creation logic in InvitationsController::create() treats the groups attribute from the client as authoritative and does not enforce that:

  • Group assignments are limited to roles the inviter is allowed to grant, or
  • Group membership changes are validated against a least-privilege policy.

This missing validation breaks the intended privilege boundary, enabling privilege escalation through legitimate-looking workflows instead of direct bypasses of authentication.

Potential impact

  • New user accounts can gain api.super or super-admin API access when invitations are accepted.
  • Lower-privileged operators or services can indirectly create fully privileged administrative identities.
  • Attackers may perform unrestricted API operations, including configuration changes, user management, and data access.
  • Compromise of audit integrity, as privileged actions appear to originate from newly created legitimate accounts rather than the original lower-privileged caller.

General mitigation guidance

Effective mitigation focuses on tightening privilege management around user provisioning flows and group assignments:

  • Enforce role-granting rules that restrict which groups a caller is allowed to assign, typically limiting them to a subset equal to or lower than their own effective privileges.
  • Validate and normalize group identifiers server-side, ignoring or rejecting any group names not allowed by policy, rather than trusting client-provided values.
  • Implement a least-privilege onboarding process, where new accounts default to minimal roles and require separate, audited steps for elevation.
  • Centralize authorization checks so that any operation altering group membership consistently consults the same policy layer, reducing the chance of bypass paths in invitation workflows.
  • Consider additional approval or review workflows for assignments to highly privileged groups, especially those mapped to api.super or equivalent capabilities.

How teams detect issues like this

Detection can leverage both code-centric and operational approaches:

  • Use static analysis or code review checklists to flag patterns where client-supplied group or role identifiers are applied directly to user accounts without policy checks.
  • Search for authorization gaps in provisioning paths (e.g., invitation creation, self-signup, bulk import) where group assignments are not tied back to the caller's own privileges.
  • Implement audit logging that records: who created invitations, which groups were requested, and resulting group memberships when invitations are accepted; then alert on invitations placing accounts into highly privileged groups.
  • Employ automated policy enforcement tools or middleware that intercepts user/group changes and validates them against a central authorization policy, regardless of which controller or endpoint initiates the change.

Sources

SourceLink
github.comgithub.com/getgrav/grav-plugin-api/commit/f9438d4e71389b1041ac60b69b0b5714ecfa3bdd
github.comgithub.com/getgrav/grav/commit/345e79e3abf8c15f80e612a09f6643300071324b
github.comgithub.com/getgrav/grav/security/advisories/GHSA-m86m-jjcg-gcvv
vulncheck.comvulncheck.com/advisories/grav-api-plugin-privilege-escalation-via-invitations-groups

Frequently asked

questions

Yes, if the Grav API is network-accessible and a user or service account holds api.users.write, that caller can exploit the issue by crafting invitation requests with elevated groups.

No. Exploitation specifically relies on a lower-privileged account with api.users.write creating invitations that assign groups with api.super or equivalent privileges.

Apply strict server-side validation that ties group assignment to a central authorization policy, ensuring callers can only assign roles they are explicitly allowed to grant, and rejecting or sanitizing any out-of-policy groups in invitations.

Design APIs with least privilege and explicit delegation rules, centralize authorization checks for role and group changes, and include provisioning workflows like invitations in regular security reviews and automated tests that verify privilege boundaries.

Find out what's already
exploitable in your codebase.