Summary
Grav's Comments plugin exposes an administrative comment-data handler without verifying that the requester is authenticated. On sites using the classic Admin plugin, an unauthenticated remote user may retrieve recent comments, commenter email addresses, and server filesystem paths.
Affected context
The issue occurs in Grav deployments using the Comments plugin with the classic Admin plugin, where the comment handler is reachable through an administrative route. The handler treats the presence of the admin service on the route as sufficient authorization and can respond before the normal Admin login flow is shown. Grav deployments using the Admin Next stack through admin2 and api are not affected through this path.
Exploit preconditions
- Attack surface: The Comments plugin's administrative comment-data endpoint
- Required access: No authentication is required when the vulnerable classic Admin route is exposed
- Trigger point: A request to the paginated comments handler
- Why exploitation is possible: The handler checks whether the admin service is registered rather than whether the requester has an authenticated account with the required administrative permission
Why this happens
The underlying bug is a missing authorization check in an administrative request handler. A route-level service-state check is incorrectly used as a substitute for authentication and permission validation, allowing unauthenticated requests to receive sensitive JSON data. This maps to CWE-306: Missing Authentication for Critical Function, because a protected administrative function can be invoked without establishing the caller's identity.
Potential impact
- Unauthorized disclosure of recent user comments
- Exposure of commenter email addresses
- Disclosure of absolute server filesystem paths
- Privacy violations and increased phishing or spam risk
- Improved reconnaissance for follow-on attacks
General mitigation guidance
Mitigation generally focuses on enforcing authentication and authorization at the handler boundary rather than relying on route registration state.
Common defensive patterns include:
- Require an authenticated administrator before processing comment-data requests
- Enforce narrowly scoped permissions such as a dedicated comments-management capability
- Return only the minimum data needed by the administrative interface
- Remove filesystem paths and other internal metadata from externally returned responses
- Apply deny-by-default access controls to administrative routes
- Keep administrative components isolated from public request paths where practical
- Use least-privilege accounts and limit access to comment data
How teams detect issues like this
Organizations can look for this class of issue through:
- Static analysis rules identifying administrative handlers that lack authentication or permission checks
- Code review checks comparing route registration checks with actual user identity and capability validation
- Tests that request administrative endpoints without credentials and verify an authorization failure
- Web access-log searches for unauthenticated requests to comment-management routes and unusual pagination patterns
- Response-content monitoring for email addresses, filesystem paths, or other administrative metadata
- Policy enforcement requiring authentication middleware and deny-by-default authorization for admin endpoints
Automated security review tools may help identify handlers that return sensitive data before access control is applied.

