/

CVE-2026-62667

Severity:

HIGH RISK

(8.1)

Broken Access Control (CWE-862) in Grav API Plugin

CVE-2026-62667

Deferred

Vulnerability type

Category:

Broken Access Control

CWE:

CWE-862

Impact:

Unauthorized Privileged Operations

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

A broken access control vulnerability in the Grav API Plugin causes API keys to be authenticated with their owner's complete identity instead of their declared scopes. An attacker holding a key intended for limited read access may therefore perform write, deletion, or administrative actions permitted to the owning user.

Affected context

The issue occurs in Grav API Plugin deployments that use API keys with declared scopes. It becomes risky when authentication returns the full owner identity without preserving or enforcing the key's restricted permissions, allowing downstream authorization checks to evaluate the owner's broader ACL instead of the key's intended capabilities.

Exploit preconditions

  • Attack surface: Grav API endpoints exposed through the RESTful API plugin
  • Required access: A valid API key with fewer privileges than its owning user
  • Trigger point: An authenticated request to an endpoint protected by AbstractApiController::requirePermission()
  • Why exploitation is possible: The authenticator does not apply the key's declared scopes, so authorization evaluates the complete ACL of the key owner

Why this happens

The underlying bug is a failure to preserve authorization context during authentication. Although the key manager records a declared scopes array, the authenticator returns the owning user's complete identity without incorporating those restrictions. Subsequent permission checks therefore trust an over-privileged identity rather than the capabilities granted to the credential, mapping to CWE-862: Missing Authorization.

Potential impact

  • An attacker may perform unauthorized content modifications
  • An attacker could delete content or other managed resources
  • An attacker may access administrative operations available to the key owner
  • Site integrity, availability, or confidentiality could be affected
  • Compromised credentials could enable broader actions than intended

General mitigation guidance

Mitigation generally focuses on enforcing authorization restrictions at every request boundary and treating API-key scopes as independent capabilities rather than metadata.

Common defensive patterns include:

  • Apply the effective key scopes during authentication and authorization
  • Fail closed when scopes are absent, malformed, or inconsistent with the credential
  • Ensure every sensitive endpoint checks the credential's effective permissions
  • Issue narrowly scoped keys and avoid sharing keys across applications or workflows
  • Separate administrative credentials from routine read or automation credentials
  • Review and revoke credentials whose effective permissions exceed their intended purpose
  • Record authorization decisions and protect audit logs from unauthorized modification

How teams detect issues like this

Organizations can identify similar issues through:

  • Static analysis that tracks declared scopes from credential creation through authorization
  • Code review checks for authentication paths that return full user identities
  • Tests confirming that read-only, content-specific, and administrative keys cannot cross their intended boundaries
  • Policy checks requiring deny-by-default authorization for API endpoints
  • Monitoring for write, delete, or administrative requests made with limited-scope credentials
  • Automated security review tools that flag unused permission fields or authorization decisions based only on account identity

Sources

SourceLink
github.comgithub.com/getgrav/grav-plugin-api/commit/dfcc947f0d6758772caac290c68fe8d4c4a4874e
github.comgithub.com/getgrav/grav-plugin-api/releases/tag/1.0.6
github.comgithub.com/getgrav/grav/security/advisories/GHSA-x7hm-jc32-v39j

Frequently asked

questions

Yes, where the Grav API is reachable and an attacker possesses a valid API key whose declared scope is narrower than the owning user's permissions.

No. The key may be intended for limited access; exploitation occurs because the server can apply the owner's broader ACL instead of the key's scope.

Enforce the key's effective scopes during every authorization decision, use deny-by-default behavior, and ensure sensitive operations require explicit permission.

Test each credential type against both allowed and forbidden operations, minimize key permissions, separate administrative credentials, and monitor for privilege-boundary violations.

Find out what's already
exploitable in your codebase.