Precious Metals Automated Product Pricing – Pro <= 4.0.5 - Missing Authorization
Description
The Precious Metals Automated Product Pricing – Pro plugin for WordPress is vulnerable to unauthorized access due to a missing capability check on a function in versions up to, and including, 4.0.5. This makes it possible for unauthenticated attackers to perform an unauthorized action.
CVSS Vector Breakdown
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:NTechnical Details
<=4.0.5# Exploitation Research Plan: CVE-2026-39704 (Precious Metals Automated Product Pricing – Pro) ## 1. Vulnerability Summary The **Precious Metals Automated Product Pricing – Pro** plugin (up to 4.0.5) contains a missing authorization vulnerability. This flaw exists because specific AJAX or REST API …
Show full research plan
Exploitation Research Plan: CVE-2026-39704 (Precious Metals Automated Product Pricing – Pro)
1. Vulnerability Summary
The Precious Metals Automated Product Pricing – Pro plugin (up to 4.0.5) contains a missing authorization vulnerability. This flaw exists because specific AJAX or REST API endpoints do not implement capability checks (e.g., current_user_can()) or proper nonce verification before performing sensitive operations. Specifically, an unauthenticated attacker can likely trigger product price updates, modify plugin settings, or manipulate how precious metal spot prices are calculated/displayed.
2. Attack Vector Analysis
- Endpoint: Likely a WordPress AJAX handler (
/wp-admin/admin-ajax.php) or a REST API route (/wp-json/...). - Action String (Inferred): Given the plugin's purpose, the AJAX action is likely named something like
pm_save_settings,pm_update_prices,pm_refresh_spot_price, orupdate_metal_margins. - Payload Parameters: Likely contains settings fields (e.g.,
pm_api_key,pm_margin_percentage) or product IDs. - Authentication: None required (unauthenticated). The vulnerability allows the execution of an action that should be restricted to administrators.
- Preconditions: The plugin must be active. If the vulnerable action is related to WooCommerce products, WooCommerce must also be active.
3. Code Flow (Inferred)
- Registration: The plugin registers an AJAX action using
add_action( 'wp_ajax_nopriv_{action_name}', ... )oradd_action( 'wp_ajax_{action_name}', ... ). - Handler Entry: When a request hits
admin-ajax.phpwith the correspondingactionparameter, the handler function is invoked. - Missing Check: Inside the handler, the code fails to call
current_user_can( 'manage_options' ). - Sensitive Sink: The handler proceeds to call functions like
update_option(),update_post_meta(), orwp_update_post()using data directly from$_POSTor$_REQUEST.
4. Nonce Acquisition Strategy
If the endpoint requires a nonce for CSRF protection (even if it lacks authorization), it must be obtained from the frontend or admin pages.
- Discovery: Use
grep -r "wp_create_nonce" .in the plugin directory to find the action string. - Localization: Look for
wp_localize_scriptin the code to see where the nonce is exposed to the frontend.- Inferred Variable:
window.pm_ajax?.nonceorwindow.pm_vars?.nonce.
- Inferred Variable:
- Shortcode Usage: Identify if the plugin uses a shortcode (e.g.,
[precious_metals_pricing]) to display price charts. - Extraction Steps:
wp post create --post_type=page --post_status=publish --post_content='[target_shortcode]'browser_navigate(URL_OF_NEW_PAGE)NONCE = browser_eval("window.IDENTIFIER?.nonce_key")
5. Exploitation Strategy
This plan assumes the vulnerability allows modifying plugin settings via an AJAX action.
- Identify Vulnerable Action: Search the plugin files for
wp_ajax_nopriv_.- Example Search:
grep -rn "wp_ajax_nopriv_" .
- Example Search:
- Analyze Handler: Check if the handler calls
update_option. - Craft Request:
- URL:
http://localhost:8080/wp-admin/admin-ajax.php - Method:
POST - Content-Type:
application/x-www-form-urlencoded - Parameters:
action:{discovered_action}_wpnonce:{extracted_nonce}(if applicable)setting_name:pm_margin_multiplier(example)value:500(malicious value to inflate prices)
- URL:
- Execute: Use the
http_requesttool to send the payload.
6. Test Data Setup
- Install and activate the plugin:
wp plugin activate precious-metals-automated-product-pricing-pro. - (Optional) Install WooCommerce if the plugin depends on it:
wp plugin activate woocommerce. - Create a test product:
wp post create --post_type=product --post_title="Gold Bar" --post_status=publish. - Configure a base price if required by the plugin settings.
7. Expected Results
- Response: The HTTP request should return a
200 OKresponse, often with a JSON body like{"success":true}or1. - Database Change: The WordPress option or post meta associated with the plugin should be updated to the attacker-supplied value.
8. Verification Steps
- Check Options: Use WP-CLI to verify if settings were changed:
wp option get {plugin_setting_name}
- Check Product Meta: If the exploit targeted a specific product:
wp post meta list {product_id}
- Check Frontend: Navigate to the product page or price chart page to see if the displayed price reflects the malicious manipulation.
9. Alternative Approaches
- Settings Injection: If the plugin saves settings as an array, try injecting malicious keys into the
$_POSTarray to overwrite arbitrary plugin configurations. - Unauthenticated Spot Price Refresh: If the vulnerable function is
pm_refresh_prices, an attacker might be able to DOS the site or the API by triggering thousands of simultaneous price update requests, potentially exhausting API quotas or server resources. - REST API Path: If no AJAX actions are found, scan for
register_rest_routeand check for any route with'permission_callback' => '__return_true'that performs anUPDATEorPOSToperation.
Summary
The Precious Metals Automated Product Pricing – Pro plugin for WordPress is vulnerable to unauthorized access due to a missing authorization check on sensitive functions in versions up to 4.0.5. This allows unauthenticated attackers to perform administrative actions, such as updating product prices or modifying plugin configuration, by targeting vulnerable AJAX or REST API endpoints.
Exploit Outline
1. Identify the target AJAX action by searching the plugin source for 'wp_ajax_nopriv_' registrations (e.g., actions intended for price updates or settings management). 2. Determine if the handler function lacks both current_user_can('manage_options') and check_ajax_referer() calls. 3. If a nonce is required for the request, extract it from the frontend by viewing the page source or inspecting localized script objects (e.g., window.pm_vars). 4. Craft a POST request to /wp-admin/admin-ajax.php with the 'action' parameter and any relevant data payloads (e.g., 'pm_margin_percentage=500') to modify site behavior. 5. Execute the request and verify that the plugin settings or product prices have been updated in the database.
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.