================================================================================ legitbiz[research] // advisory ================================================================================ id: LB-2026-002 // wp-megamenu target: WP Mega Menu (wp-megamenu) <= 1.4.2 active: ~20,000 installs type: PHP Object Injection (CWE-502) + SQL Injection (CWE-89) severity: High (CWE-502 / CWE-89 / CWE-862) cna / portal: Patchstack VDP / Wordfence date: 2026-11-27 status: submitted / coordinated disclosure researcher: legitbiz[research] -------------------------------------------------------------------------------- [01] // summary -------------------------------------------------------------------------------- The menu import handler in WP Mega Menu has no capability check (missing current_user_can), verifying only a nonce. It takes base64-decoded user file content and passes it directly to unserialize(), permitting PHP Object Injection. Furthermore, a field from the deserialized object is interpolated directly into a SQL query without parameterization, enabling SQL Injection. -------------------------------------------------------------------------------- [02] // vulnerable code (classes/class.wp-megamenu-export-import.php) -------------------------------------------------------------------------------- No capability check on admin_init:  add_action('admin_init', array($this, 'wpmm_import_menu')); Object Injection (line 173):  if (wpmm_is_serialized(base64_decode($serilized_data))) {  $post_data = unserialize(base64_decode($serilized_data)); // CWE-502  } SQL Injection (lines 211-212):  $terms_name = $post_data->terms->name;  $duplicate_nav_count = (int) $wpdb->get_var(  "SELECT COUNT(term_id) FROM {$wpdb->terms} WHERE NAME LIKE '%{$terms_name}%' "); -------------------------------------------------------------------------------- [03] // proof of concept -------------------------------------------------------------------------------- 1. Craft serialized PHP object payload: O:8:"SomeGadget":... and base64-encode. 2. Save into a .txt file. 3. Submit import form on WP Mega Menu -> Themes. 4. Payload executes via unserialize() triggering __wakeup() / __destruct(). 5. For SQLi: set terms->name to: x%' UNION SELECT user_pass FROM wp_users-- - -------------------------------------------------------------------------------- [04] // remediation -------------------------------------------------------------------------------- - Add if (!current_user_can('manage_options')) return; to import handlers. - Replace unserialize() with json_decode(), or pass ['allowed_classes' => false]. - Parameterize SQL queries with $wpdb->prepare(). ================================================================================