/

CVE-2026-42613

Severity:

CRITICAL RISK

(9.4)

Authorization Bypass via Improper Input Validation

CVE-2026-42613

Deferred

Vulnerability type

Category:

Authorization Bypass via Improper Input Validation

CWE:

CWE-20, CWE-862

Impact:

Privilege Escalation to Administrative Access

Severity:

CRITICAL RISK

(9.4)

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 Login plugin's registration handler accepts attacker-controlled groups and access fields from user signup data without proper server-side validation.

When registration is enabled and these fields are allowed, an unauthenticated user can register an account with admin.super privileges, effectively bypassing normal authorization controls.

Affected context

This vulnerability appears in Grav installations that:

  • Use the Login plugin with user self-registration enabled
  • Include groups and/or access in the list of allowed registration fields
  • Rely on client-provided form fields to define user roles and capabilities

In such setups, the registration endpoint becomes a path where untrusted POST data is treated as authoritative for assigning user privileges.

Exploit preconditions

  • Attack surface: Public web interface, specifically the user registration endpoint exposed by the Login plugin.
  • Required access: No prior authentication is required; an attacker only needs network access to the registration form or endpoint.
  • Trigger point: Submission of a crafted registration POST request that includes groups and/or access fields set to high-privilege values (e.g., admin.super), when those fields are configured as allowed.
  • Why exploitation is possible: The server-side registration logic trusts client-supplied group and access data and lacks an authorization gate or whitelist-based enforcement on which privileges may be self-assigned.

Why this happens

The core issue is that the Login::register() method conflates user-controlled input with security-sensitive authorization data.

Instead of treating groups and access as privileged configuration determined by trusted administrators, it accepts them directly from registration POST data when allowed by configuration.

This is a combination of:

  • CWE-20: Improper Input Validation, because the application does not validate or constrain the values supplied for group and access fields.
  • CWE-862: Missing Authorization, because there is no dedicated authorization check that prevents unauthenticated users from assigning themselves administrative roles.

Abstractly, this reflects an insecure pattern where role/permission assignment is driven by untrusted client fields rather than server-side, policy-enforced logic.

Potential impact

  • An unauthenticated attacker could create a new account with full admin.super privileges.
  • Attackers can manage site configuration, users, plugins, and content as if they were legitimate administrators.
  • Complete compromise of the Grav site, including defacement, data exfiltration, and destructive changes.
  • Potential for further compromise of connected systems (e.g., via malicious plugin uploads or configuration changes).
  • Long-term persistence by creating additional high-privilege accounts or backdoor configurations.

General mitigation guidance

Defensive strategies focus on separating untrusted registration data from authorization controls and enforcing strict server-side policy:

  • Treat group and access assignments as server-controlled properties, not form-driven inputs, even if configuration exposes them.
  • Implement a fixed, minimal-privilege role (e.g., basic user group) that is automatically applied to all self-registered accounts, regardless of client-supplied fields.
  • Enforce strict whitelists on which groups or access scopes can ever be assigned at registration, configured and enforced on the server.
  • Add explicit authorization checks to ensure only already-privileged users or trusted processes can grant elevated permissions.
  • Use defense-in-depth by:
  • Avoiding exposure of sensitive fields like groups and access in registration forms.
  • Applying principle of least privilege to all default roles and capabilities.
  • Review registration and profile update flows across the application for similar patterns where users can influence their own roles or permissions.

How teams detect issues like this

Identification typically involves both code-centric and configuration-centric review:

  • Code review signals:
  • Registration or profile update code that reads groups, roles, or access directly from request data.
  • Conditionals that depend solely on configuration flags to accept sensitive fields without enforcing business rules.
  • Absence of dedicated authorization checks around permission or group assignments.
  • Static analysis patterns:
  • Rules that flag when permission-related fields are derived from untrusted input ($_POST, request body, query parameters).
  • Data-flow analysis tracing user-controlled input into role assignment or access-control structures.
  • Configuration audits:
  • Automated checks for deployments where registration is enabled and groups / access are listed as allowed fields.
  • Monitoring for newly created accounts with administrative privileges, especially if registration is publicly accessible.
  • Organizations may also use security scanners or custom CI checks to detect insecure role-assignment flows and enforce policy that permission changes occur only in restricted administrative endpoints.

Sources

SourceLink
github.comgithub.com/getgrav/grav-plugin-login/commit/3d419a0dabd70aed1fd49afcd5919004a4141da1
github.comgithub.com/getgrav/grav/security/advisories/GHSA-pxm6-mhxr-q4mj
github.comgithub.com/getgrav/grav/security/advisories/GHSA-w48r-jppp-rcfw

Frequently asked

questions

Yes. As long as the registration endpoint is reachable and registration is enabled with the affected configuration, an attacker can exploit it remotely over HTTP/HTTPS without prior access.

No. The vulnerability can be exploited by unauthenticated users; it occurs during the creation of a new account via the registration process.

The most robust pattern is to remove any reliance on client-supplied groups or access fields for new registrations and assign a fixed, low-privilege role on the server side. Any elevation of privileges should require an already-authorized administrator acting through a dedicated, authenticated admin interface.

Design registration and profile flows under a clear rule that roles, groups, and permissions are never controlled by untrusted input. Enforce server-side validation and authorization checks for any operation that affects permissions, use least-privilege defaults, and include targeted code review and automated checks that flag when request data influences authorization state.

Find out what's already
exploitable in your codebase.