/

CVE-2026-72822

Severity:

HIGH RISK

(8.8)

Missing API Scope Checks (CWE-306) in Grav API Plugin

CVE-2026-72822

Deferred

Vulnerability type

Category:

Missing Authentication for Critical Function

CWE:

CWE-306

Impact:

Unauthorized two-factor authentication disablement and potential account takeover

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

Grav's API plugin does not enforce API key scope limits on the non-self user path of the 2FA disable endpoint. A qualifying API key holder may disable two-factor authentication for another non-super account without supplying a TOTP code, potentially enabling account takeover.

Affected context

The issue occurs in Grav deployments using the API plugin's user management endpoint for disabling two-factor authentication. It becomes risky when an API key is associated with a super account or an account whose ACL grants user-write access, while the endpoint fails to apply the key's configured scope cap to operations against other users.

Exploit preconditions

  • Attack surface: Authenticated HTTP API access to the user 2FA management endpoint - Required access: A valid API key associated with a qualifying account and sufficient ACL context - Trigger point: A POST request to the non-self user 2FA disable operation - Why exploitation is possible: The endpoint checks selected ACL conditions but does not invoke the permission enforcement path that applies API key scope restrictions, and it does not require a TOTP code for the targeted account

Why this happens

The endpoint implements authorization inconsistently with its sibling operation. Instead of invoking the centralized permission check that enforces API key scope caps, the non-self path relies on direct ACL reads such as super-administrator or user-write checks. This leaves a critical account-security function accessible under broader conditions than intended and maps to CWE-306, Missing Authentication for Critical Function.

Potential impact

  • An attacker may disable two-factor authentication for another user account.
  • Affected users could lose an important account-protection control.
  • An attacker could use subsequent credential access to take over an account.
  • Administrative or user data may be exposed or modified after account compromise.

General mitigation guidance

Mitigation generally focuses on making authorization checks centralized, complete, and fail-closed for every account-management operation. The endpoint should consistently enforce API key scope caps, require operation-specific permissions for the target account, and preserve step-up verification where disabling 2FA is a sensitive action. API keys should use the narrowest practical privileges, and account-management functions should avoid relying on broad role or ACL checks alone.

How teams detect issues like this

Detection can include static analysis and code review rules that compare sibling endpoint authorization paths, identify sensitive handlers that bypass centralized permission functions, and flag direct ACL checks without scope enforcement. Runtime monitoring can alert on 2FA-disable operations performed through API keys, especially when the requester and target differ or when the key has a narrow scope. Policy checks can require step-up verification and explicit target-resource authorization for account-security changes.

Sources

SourceLink
github.comgithub.com/getgrav/grav/security/advisories/GHSA-22p9-6fh4-mmf2
vulncheck.comvulncheck.com/advisories/grav-before-authentication-bypass-via-disable2fa

Frequently asked

questions

Yes. It can be triggered through the Grav API when an attacker has a qualifying valid API key and the endpoint is reachable.

The attacker needs an API key tied to a super account or to an account whose ACL grants the relevant user-write capability. The key's narrow scope is not sufficient protection when the endpoint skips scope enforcement.

Apply centralized permission and API scope checks consistently to every sensitive operation, including requests targeting users other than the caller, and require appropriate step-up verification for disabling 2FA.

Use shared authorization middleware, test scope boundaries for self and non-self targets, review all account-security endpoints for fail-open paths, and monitor unusual 2FA changes made through API credentials.

Find out what's already
exploitable in your codebase.