/

CVE-2026-62231

Severity:

HIGH RISK

(8.1)

Authorization Bypass (CWE-863) in Grav API Plugin

CVE-2026-62231

Deferred

Vulnerability type

Category:

Authorization Bypass

CWE:

CWE-863

Impact:

Privilege Escalation via Scope Ignoring

Severity:

HIGH RISK

(8.1)

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

The Grav API plugin contains an authorization bypass where API key scopes are defined but never enforced by the authentication logic.

As a result, keys intended to be limited (such as read-only) can perform any action allowed to the owning user account, including writes, deletes, and administrative operations whenever the API is exposed.

Affected context

This vulnerability appears in Grav deployments that use the API plugin to issue scoped API keys for programmatic access.

It primarily affects environments where administrators rely on scope-based restrictions to separate read-only keys from keys that can modify content or perform administrative tasks. When the API is reachable and keys are issued under the assumption that scopes will be honored, the gap between intended and actual permissions becomes security-relevant.

Exploit preconditions

  • Attack surface: Grav API endpoints exposed over HTTP/HTTPS
  • Required access: Possession of a valid API key with ostensibly restricted scopes (e.g., read-only)
  • Trigger point: Any authenticated API call where the plugin should enforce per-key scope restrictions
  • Why exploitation is possible: The ApiKeyAuthenticator returns the full user account and ignores the scopes array, so authorization decisions are made using the user's full permissions rather than the key's intended limitations.

Why this happens

The core issue is a mismatch between the authorization model and its implementation: the system supports scoped API keys but the authenticator never consults or enforces those scopes.

Instead, it treats possession of the key as equivalent to full ownership privileges, passing the complete user account to subsequent authorization checks.

This maps to CWE-863: Incorrect Authorization, where access control logic fails to restrict operations according to contextual constraints (in this case, per-key scopes), leading to broader permissions than intended.

Potential impact

  • API keys intended as read-only may perform content modifications and deletions.
  • Scoped keys can invoke administrative endpoints available to the owning user.
  • Service accounts or integrations may unintentionally gain broad control over the CMS.
  • Compromise of a low-privilege API key could lead to effective full-account compromise.
  • Data integrity issues through unauthorized updates or content tampering.

General mitigation guidance

Mitigation patterns focus on aligning authorization checks with declared scopes and reducing trust in bearer tokens:

  • Treat API keys as capability tokens whose allowed actions are explicitly derived from their scope definitions, not just the owning user's role.
  • Implement centralized authorization middleware that evaluates both user identity and key scope for each API route and HTTP method.
  • Use explicit permission mapping for endpoints (e.g., read, write, admin) and require that both user role and key scope satisfy the required permission set.
  • Avoid overloading authentication artifacts; separate identity (user) from capability (scoped key) and ensure least-privilege defaults for new keys.
  • Regularly review access models to ensure that "limited" credentials cannot silently escalate to full-account privileges.

How teams detect issues like this

Effective detection generally combines code-level verification with behavioral checks:

  • Static analysis and manual code review looking for authorization paths that rely solely on user identity and ignore per-token scope or context.
  • Inspection of authenticator classes and middleware to confirm that scopes or equivalent constraints are evaluated for every API endpoint.
  • Logging and monitoring of API usage to flag anomalous write or administrative operations performed using keys that are marked as read-only or limited.
  • Policy-based testing where test suites exercise scoped keys against privileged endpoints to verify that access is denied as expected.
  • Incorporating automated security review tools in CI pipelines to highlight missing scope checks or overly permissive access control logic.

Sources

SourceLink
github.comgithub.com/getgrav/grav/security/advisories/GHSA-x7hm-jc32-v39j
vulncheck.comvulncheck.com/advisories/grav-api-key-scope-bypass-via-apikeyauthenticator

Frequently asked

questions

The issue affects any environment where scoped API keys are used under the assumption they enforce limited access. If an attacker or integration holds such a key, they can act with the full privileges of the owning user wherever the API is exposed.

An attacker needs access to a valid API key tied to a user account. Even if that key was configured as read-only or otherwise restricted, the missing scope enforcement enables the attacker to perform any action available to that user.

The most robust pattern is to centralize authorization checks so that every API request is evaluated against both user permissions and key-specific scopes. Each endpoint should declare the required capabilities (read, write, admin), and the request should only succeed if both the user and the key explicitly allow those capabilities.

Preventive measures include designing a clear access control model where scopes, roles, and permissions are explicitly mapped, enforcing least privilege by default, and requiring code reviews for any authentication or authorization changes. Automated tests that verify scoped credentials cannot access disallowed operations, combined with static analysis for missing scope checks, help catch such issues early in development.

Find out what's already
exploitable in your codebase.