Issue Summary:
When using Security Ninja's 2FA feature in conjunction with the Nextend Social Login plugin, users are unable to complete the login process due to a nonce validation error. The issue arises during the "Skip for now" functionality in the 2FA form, where the nonce is generated for a logged-in user but fails verification after session invalidation.
Steps to Reproduce:
{
"code": "rest_invalid_param",
"message": "Invalid parameter(s): nonce",
"data": {
"status": 400,
"params": { "nonce": "Invalid parameter." },
"details": []
}
}
Technical Details Provided by Nextend Social Login:
The issue occurs because Security Ninja invalidates the session partially during 2FA setup using:
self::destroy_current_session_for_user( $user );
wp_clear_auth_cookie();
However, this does not fully clear the session or reset login-specific properties, which leads to the invalid nonce generation.
Suggested Fix:
Modify the session invalidation logic by incorporating or replicating the
wp_logout()
Temporary Workaround:
Nextend Social Login has provided the following workaround to skip 2FA enforcement during their authentication process:
add_action('nsl_before_wp_login', function () {
remove_action('wp_login', 'WPSecurityNinja\Plugin\Wf_Sn_2fa::wp_login', 10);
});
Expected Behavior:
Users should be able to log in seamlessly via Nextend Social Login without encountering nonce validation errors, and the "Skip for now" functionality should work as intended.
Additional Context:
Action Items for Technician:
class-wf-sn-2fa.php
wp_login()
Priority: High – Affects core functionality for users relying on third-party social login systems.
4 months ago
Released in 5.224
0 4 months ago Reply
4 months ago
4 months ago