Skip to main content

Remediation Steps

Follow the steps below to remediate this finding on WordPress.

  1. Ensure all forms use WordPress nonces for CSRF protection.

  2. In form output:

    wp_nonce_field('my_action', 'my_nonce_field');
  3. In form processing:

    if (!isset($_POST['my_nonce_field']) || !wp_verify_nonce($_POST['my_nonce_field'], 'my_action')) {
    wp_die('Invalid nonce.');
    }
  4. For AJAX requests, use wp_localize_script() to pass a nonce and verify with check_ajax_referer().