Bugfix: Missing Authorization Vulnerability in AJAX Handlers (CVE-2024)
-
Plugin Version: 2.0.0 – 2.0.1
Severity: Medium (CVSS 4.3)
Description:
The VG Wort METIS plugin is vulnerable to unauthorized access due to missing capability checks in multiple AJAX handlers. While the plugin correctly implements nonce verification, this only confirms that the request originated from a logged-in user’s session – it does not verify whether that user has the appropriate permissions to perform the requested action.This means any authenticated WordPress user (including subscribers) could potentially:
- Assign or remove pixels from posts
- Manage participant data
- Access pixel validation endpoints
Affected Functions:
assign_pixel_to_post_ajax()inincludes/actions/assign_pixel.phpremove_pixel_from_post_ajax()inincludes/actions/remove_pixel.phpmanually_assign_pixel_to_post_ajax()inincludes/actions/manualy_assign_pixel.phpmetabox_check_validity_and_ownership()inincludes/actions/check_validity_and_ownership.phpget_posts_count()inincludes/actions/get_posts_count.phpparticipant_save()inadmin/page_participants.phpparticipant_delete()inadmin/page_participants.phpmanual_assign_pixel_action()inclasses/metabox.phpis_valid_and_ownership_check()inclasses/metabox.phpautomatic_assign_pixel_action()inclasses/metabox.php
Fix:
Addcurrent_user_can()capability checks at the beginning of each AJAX handler, before any other logic is executed.For pixel-related operations (requires
edit_postscapability):function assign_pixel_to_post_ajax() { // SECURITY FIX: Check user capability (CVE-2024 Missing Authorization) if ( ! current_user_can( 'edit_posts' ) ) { wp_send_json_error( array( 'message' => 'Keine Berechtigung für diese Aktion.' ) ); return; } // ... existing code ... }For administrative operations like participant management (requires
manage_optionscapability):public function participant_save(): void { // Security: Verify nonce if ( ! wp_verify_nonce( $_REQUEST['_wpnonce'] ?? '', 'participant_save_nonce' ) ) { wp_die( 'Security check failed' ); } // SECURITY FIX: Check user capability (CVE-2024 Missing Authorization) if ( ! current_user_can( 'manage_options' ) ) { wp_send_json_error( 'Keine Berechtigung für diese Aktion.' ); return; } // ... existing code ... }Important: The capability check must be placed before the nonce verification or immediately after it, but always before any business logic is executed.
Files requiring modification:
includes/actions/assign_pixel.php– addedit_postscheckincludes/actions/remove_pixel.php– addedit_postscheckincludes/actions/manualy_assign_pixel.php– addedit_postscheckincludes/actions/check_validity_and_ownership.php– addedit_postscheckincludes/actions/get_posts_count.php– addedit_postscheckadmin/page_participants.php– addmanage_optionscheck to bothparticipant_save()andparticipant_delete()classes/metabox.php– addedit_postscheck tomanual_assign_pixel_action(),is_valid_and_ownership_check(), andautomatic_assign_pixel_action()
You must be logged in to reply to this topic.