You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Plugin Name: Fix LaStudio Element Kit Vulnerability
* Description: Fixes the Administrative User Creation vulnerability in LaStudio Element Kit for Elementor plugin.
* Version: 1.0.0
* Author: Security Fix
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// 1. Remove 'lakit_bkrole' from request superglobals early to prevent triggering the vulnerability.
add_action( 'init', function() {
if ( isset( $_REQUEST['lakit_bkrole'] ) ) {
unset( $_REQUEST['lakit_bkrole'] );
}
if ( isset( $_POST['lakit_bkrole'] ) ) {
unset( $_POST['lakit_bkrole'] );
}
if ( isset( $_GET['lakit_bkrole'] ) ) {
unset( $_GET['lakit_bkrole'] );
}
}, 0 );
// 2. Change the hook key used by the vulnerable code to something harmless.
// The vulnerable code uses 'lastudio-kit/integration/sys_meta_key' filter to get the hook name (which defaults to 'insert_lakit_meta' but is changed to 'insert_user_meta' by the plugin itself).
// By changing it to a dummy hook name, we ensure that even if the vulnerable code runs, it hooks into a non-existent action instead of 'insert_user_meta'.