/

CVE-2026-42609

Severity:

HIGH RISK

(8.1)

Authorization and Access Control Logic Error in Grav Admin

CVE-2026-42609

Modified

Vulnerability type

Category:

Authorization and Access Control Logic Error

CWE:

CWE-269, CWE-285, CWE-639, CWE-837

Impact:

Privilege Manipulation and Administrative Account Takeover/Disruption

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 business logic flaw in the Grav Admin Panel allows a low-privileged user with only user-creation rights to overwrite existing user accounts, including the primary administrator.

When a new user is created with a username that already exists, Grav updates the existing account instead of rejecting the operation, enabling disruption of admin access and alteration of critical account metadata and permissions.

Affected context

This vulnerability appears in Grav installations that:

  • Use the Grav Admin Panel for user and role management
  • Delegate limited user-management capabilities (e.g., "can create users") to non-admin accounts
  • Identify accounts primarily by username in the user creation and update workflow

The issue manifests when user creation requests are not properly distinguished from user updates and when authorization checks do not ensure that only highly privileged roles can modify existing accounts.

Exploit preconditions

  • Attack surface: Grav Admin Panel user management interface (HTTP requests to user creation endpoints).
  • Required access: A valid, low-privileged account with permission to create users but not to manage or edit existing users or roles.
  • Trigger point: Submitting a "create user" request where the username field matches an existing account, including the primary administrator.
  • Why exploitation is possible: The backend logic treats a conflicting username in a creation request as an update operation on the existing account without enforcing stronger authorization checks or rejecting the conflict, allowing a low-privileged actor to overwrite metadata and permissions.

Why this happens

The core issue is an authorization and business logic error in the user management workflow.

Instead of enforcing a strict separation between user creation and user modification, the system appears to rely on the username as both a unique identifier and an implicit selector for update operations.

When a "create" request references a username that already exists, the application updates the existing user's record without:

  • Verifying that the caller has privileges to edit that account, and
  • Rejecting the creation attempt due to a uniqueness conflict.

This maps primarily to CWE-269: Improper Privilege Management, with related aspects of:

  • CWE-285: Improper Authorization – insufficient checks before modifying existing accounts
  • CWE-639: Authorization Bypass Through User-Controlled Key – user-controlled username drives which account is altered
  • CWE-837: Stateful Behavior – incorrect handling of state (existing vs. new account) across operations.

Potential impact

  • A low-privileged user can overwrite the primary administrator account's metadata (e.g., email, profile data).
  • Administrative permissions and roles can be altered or removed, leading to effective denial of service for legitimate admins.
  • Downgrade (de-escalation) or unexpected change of the root account's capabilities, potentially locking out or confusing operational owners.
  • Disruption of normal user management, incident response, and administrative workflows.
  • Creation of persistence by changing account details to attacker-controlled values (e.g., contact email), which may assist in subsequent social or technical attacks.

General mitigation guidance

Effective mitigation centers on tightening authorization and clarifying the user lifecycle in code:

  • Enforce strict uniqueness checks on usernames (or primary identifiers) during user creation, returning a clear error when a username is already in use.
  • Separate "create user" and "update user" paths in both routing and business logic, with independent permission checks for creation vs. modification.
  • Require higher-privileged roles for updating or deleting existing accounts, especially for accounts with administrative capabilities.
  • Treat user identifiers used in update operations as sensitive, and never let them be the sole basis for selecting accounts without verifying that the caller is authorized for that specific target.
  • Consider using immutable primary identifiers (e.g., internal IDs) for updates and reference checks, while treating usernames as attributes that can be validated and constrained.
  • Apply least-privilege role design so that "user creation" permissions do not implicitly grant any ability to edit or overwrite existing accounts.

How teams detect issues like this

Organizations can detect this class of issues through a combination of review and automated checks:

  • Code review: Examine user management controllers/services for:
  • Combined create/update ("upsert") logic driven by user-controlled keys such as username.
  • Missing or weak authorization checks when modifying existing accounts.
  • Lack of explicit uniqueness enforcement on usernames or login identifiers.
  • Static analysis and linting: Configure rules or custom checks to flag:
  • Use of user-controlled identifiers (username, email, user_id from request) directly in update operations without contextual authorization.
  • Endpoints that can both create and update records based on a single field's presence or collision.
  • Security testing: Perform role-based tests where a low-privileged user attempts:
  • To create accounts using usernames of existing privileged users.
  • To alter their own role or another user's role via crafted requests.
  • Runtime monitoring: Log and alert on suspicious patterns, such as:
  • Multiple account "creation" attempts targeting usernames that already exist.
  • Changes to administrative accounts performed by non-administrative roles.

Automated application security testing tools, including SAST, DAST, and IAST, can augment manual review by highlighting authorization inconsistencies and stateful logic flaws in user-related workflows.

Sources

SourceLink
github.comgithub.com/getgrav/grav/commit/5a12f9be8314682c8713e569e330f11805d0a663
github.comgithub.com/getgrav/grav/commit/c66dfeb5ff679a1667678c6335eb9ff3255dfc47
github.comgithub.com/getgrav/grav/commit/d904efc33e03ebb597afde8d3368b28cf0423632
github.comgithub.com/getgrav/grav/security/advisories/GHSA-rr73-568v-28f8

Frequently asked

questions

Yes. Any attacker who can access the Grav Admin Panel over the network and obtain a low-privileged account with user-creation permissions can exploit this flaw remotely, subject to the deployment's access controls (e.g., VPN, IP restrictions).

The attacker must be authenticated as a user who is allowed to create new accounts via the Admin Panel. They do not need permissions to edit existing accounts, but the flawed logic effectively grants them that capability when they reuse an existing username.

The safest approach is to clearly separate creation and update operations and enforce strict uniqueness and authorization:

  • Reject user creation attempts when the username already exists.
  • Require explicit, high-privilege authorization for any operation that modifies existing accounts.
  • Base modification operations on trusted internal identifiers rather than user-controlled fields.

Implement a structured access control model (such as role- or attribute-based access control) and enforce it consistently across user lifecycle operations. During development:

  • Design workflows so that each action (create, read, update, delete) has explicit, testable permission rules.
  • Avoid combining create and update logic where user-controlled keys decide which path is taken.
  • Include authorization-focused unit and integration tests, and incorporate security review of business logic in code review and CI pipelines.
Find out what's already
exploitable in your codebase.