ProfileGrid – User Profiles, Groups and Communities <= 5.9.9.8 - Cross-Site Request Forgery
Description
The ProfileGrid – User Profiles, Groups and Communities plugin for WordPress is vulnerable to Cross-Site Request Forgery in versions up to, and including, 5.9.9.8. This is due to missing or incorrect nonce validation on a function. This makes it possible for unauthenticated attackers to perform an unauthorized action 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.9.8This research plan outlines the steps to investigate and exploit a Cross-Site Request Forgery (CSRF) vulnerability in **ProfileGrid – User Profiles, Groups and Communities** (<= 5.9.9.8). ### 1. Vulnerability Summary The ProfileGrid plugin fails to implement or correctly validate WordPress nonces i…
Show full research plan
This research plan outlines the steps to investigate and exploit a Cross-Site Request Forgery (CSRF) vulnerability in ProfileGrid – User Profiles, Groups and Communities (<= 5.9.9.8).
1. Vulnerability Summary
The ProfileGrid plugin fails to implement or correctly validate WordPress nonces in several of its administrative and group management functions. This allows an unauthenticated attacker to perform sensitive actions (such as modifying site settings, deleting groups, or changing user data) by tricking a logged-in administrator into visiting a malicious webpage that triggers a forged request to the vulnerable endpoint.
2. Attack Vector Analysis
- Endpoints:
- Primary:
/wp-admin/admin-ajax.php(AJAX actions) - Secondary:
/wp-admin/admin-post.php(Form submissions)
- Primary:
- Vulnerable Actions (Inferred):
pm_save_settings(Saving global plugin configurations)pm_save_group_meta(Modifying group details)pm_delete_group(Deleting user groups)
- Authentication Level: Unauthenticated attacker (requires an authenticated Administrator to execute the payload via browser interaction).
- Preconditions: The target site must have ProfileGrid <= 5.9.9.8 installed and an active administrator session.
3. Code Flow
The vulnerability likely resides in how the plugin handles AJAX or admin-post hooks.
- The plugin registers actions in
admin/class-profile-magic-admin.php(inferred) or the main plugin file usingadd_action( 'wp_ajax_ACTION_NAME', ... ). - The callback function for the action is invoked.
- The callback fails to call
check_ajax_referer()orwp_verify_nonce(), or it calls them with thedieparameter set tofalseand fails to check the return value. - User-controlled parameters from
$_POSTor$_REQUESTare passed directly to database modification functions likeupdate_option()or$wpdb->update().
4. Nonce Acquisition Strategy
If the vulnerability is a missing nonce check, no acquisition is necessary. However, if the plugin performs incorrect validation (e.g., using a generic nonce exposed on public pages), follow these steps:
- Identify Shortcode: ProfileGrid uses shortcodes like
[profilegrid_groups]or[profilegrid_profile]. - Create Setup Page:
wp post create --post_type=page --post_status=publish --post_title="ProfileGrid Test" --post_content='[profilegrid_groups]' - Navigate and Extract: Use
browser_navigateto visit the new page. - Extract Variable: Use
browser_evalto search for localized script data:browser_eval("window.pm_ajax_object?.ajax_nonce || window.profilegrid_vars?.nonce")(inferred variable names).
5. Exploitation Strategy
We will target the group creation or settings modification functionality.
Target Action: pm_save_settings (or equivalent).
Step 1: Discover Parameters
Search the plugin code for the pm_save_settings function to identify which options can be modified.grep -rn "function pm_save_settings" .
Step 2: Construct the Forge Request
Using the http_request tool, simulate a request from the Administrator's browser context.
- URL:
{{BASE_URL}}/wp-admin/admin-ajax.php - Method:
POST - Headers:
Content-Type: application/x-www-form-urlencoded - Body:
(Note: Parameters are inferred; actual parameter names must be confirmed from theaction=pm_save_settings&pm_settings_option_name=users_can_register&pm_settings_option_value=1pm_save_settingssource code.)
6. Test Data Setup
- Install Plugin: Ensure ProfileGrid version 5.9.9.8 is active.
- Create Administrator: Create a user with the
administratorrole. - Create a Group: Create at least one ProfileGrid group to test modification/deletion.
wp profilegrid create_group --title="Target Group"(if CLI support exists, otherwise via UI).
7. Expected Results
- Successful Exploit: The server responds with a success indicator (e.g.,
{"success":true}or a redirect) despite the absence of a valid_wpnonce. - Impact: The plugin's configuration or group data is updated in the database according to the attacker's payload.
8. Verification Steps
After sending the forged request, verify the state change using WP-CLI:
- Check Option:
wp option get pm_settings_users_can_register(inferred option name). - Check Group Metadata: Use
$wpdbto check thewp_pms_groups(inferred) table.wp db query "SELECT * FROM wp_pms_groups WHERE group_id = 1"
9. Alternative Approaches
- Group Deletion CSRF: If settings are protected, target group management.
- Action:
pm_delete_group - Payload:
action=pm_delete_group&group_id=1
- Action:
- Admin Post CSRF: If AJAX actions are protected, check
admin-post.phphandlers.grep -r "admin_post_" .- Target forms that save tabbed settings in the ProfileGrid dashboard.
Summary
The ProfileGrid – User Profiles, Groups and Communities plugin for WordPress (versions up to and including 5.9.9.8) is vulnerable to Cross-Site Request Forgery (CSRF). This vulnerability exists because the plugin fails to perform nonce validation on certain administrative AJAX and form-processing actions, allowing unauthenticated attackers to modify plugin settings or manipulate group data by tricking an administrator into submitting a forged request.
Exploit Outline
An attacker targets administrative functions registered through WordPress AJAX or admin-post hooks (such as 'pm_save_settings' or 'pm_delete_group') that lack protection from functions like check_ajax_referer(). The attacker then creates a malicious webpage or email containing a hidden HTML form or script that initiates a POST request to the site's /wp-admin/admin-ajax.php endpoint. By tricking an authenticated administrator into interacting with the malicious content, the attacker leverages the administrator's active session to execute sensitive operations, such as changing global plugin configurations or deleting user groups.
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.