Google reCAPTCHA v3 validation failed: The response parameter is missing

Created on 12 April 2022, almost 3 years ago
Updated 10 June 2024, 10 months ago

NOTE: This is for a form that is embedded in a node as a paragraph. In the Form Settings page the form ID of the Captcha Point is webform_submission_contact_node_10_add_form.

Recaptcha V3 not working on a contact form.

Submitting a form with Captcha V3 always fails and falls back to the secondary validation method. The error message in Recent Log Messages is:

Google reCAPTCHA v3 validation failed: The response parameter is missing.

Interestingly enough the secondary method also tries to submit during the initial posting of the form and if logging is enabled it will indicate that the secondary method was entered without a value. For instance, if the secondary method is Math, it will report:

webform_submission_contact_node_10_add_form post blocked by CAPTCHA module: challenge Math (by module captcha), user answered "", but the solution was "6".

Steps to reproduce

  1. Add a contact webform to a node as a paragraph.
  2. Within the Captcha/ReCaptcha configuration pages add a reCaptcha V3 Action.
  3. In Captcha Form Settings add a Captcha Point for your Webform (form_id).
  4. Submit the form.
  • Captcha Caching is not enabled.
  • Turning off Caching for the site in Performance -> Caching makes no difference but this is a Pantheon hosted site and there may be other caching going on that is beyond our control.
🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇨🇦Canada awasson

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇸United States seanr

    This is still extant in 2.0.2

  • 🇸🇰Slovakia poker10

    @seanr Can you open a new issue for this? We are also getting similar errors from bots even on 2.0.2.

    Google reCAPTCHA v3 validation failed: The response parameter is invalid or malformed. Expected action did not match.
    
    Google reCAPTCHA v3 validation failed: The response parameter is invalid or malformed. Expected hostname did not match. Expected action did not match.
    
  • 🇨🇦Canada karing 🇨🇦

    Is there a new issue for this? I just noticed this exact error on a /form - Drupal 10.3

    Google reCAPTCHA v3 validation failed: The response parameter is invalid or malformed. Expected hostname did not match. Expected action did not match.
    

    Even after updating to latest versions:

    root@1e5e6035d98e:/var/www/drupal# sudo -u drupal composer require 'drupal/captcha:^2.0'
    root@1e5e6035d98e:/var/www/drupal# sudo -u drupal composer require 'drupal/recaptcha_v3:^2.0'
    
  • 🇹🇷Turkey orkut murat yılmaz Istanbul

    @dench0 can you reactivate this issue?

  • 🇫🇷France sébastien-fr Nantes - France

    I just configured recaptcha v3 with v2 in fall back. I also have this error in the logs.

    Google reCAPTCHA v3 validation failed: The response parameter is missing.

    The form is /user/register

    Module :
    CAPTCHA 2.0.7
    reCAPTCHA 8.x-3.4
    reCAPTCHA v3 2.0.3

  • 🇺🇦Ukraine dench0

    @sébastien-fr

    1. Are there any errors in the browser console?
    2. Check this commentary 🐛 The response parameter is missing. Closed: works as designed . Do you see the element and does it have a value?
    3. Check if the captcha value is sent with form data on form submission.

    There are some similar issues, you can review them as well.

    Someone helped just create a new site in the google console 🐛 Error message: Antibot verification failed Fixed .

  • 🇫🇷France sébastien-fr Nantes - France

    Hello @dench0

    The markup seems ok :

    <input id="recaptcha-v3-token" class="recaptcha-v3-token form-control" data-recaptcha-v3-action="recaptcha_v3" data-recaptcha-v3-site-key="...

    How can I check if Check if the captcha value is sent with form data on form submission on a registration form ?

  • 🇺🇦Ukraine dench0

    The markup seems ok

    Is there a token value?

    How can I check if the captcha value is sent with form data on form submission on a registration form ?

    In the browser developer tools - on the network tab.

    Again this was already discussed in some of the previous issues: e.g. here 🐛 recaptcha_v3 working intermittenly Active .

    I don't mean to be rude, but I highly recommend that you check issues before creating a new question: there are only 15 issues with the "Google reCAPTCHA v3 validation failed" and it should not take a lot of time to check them.

  • 🇮🇳India newswatch Delhi/Bangalore

    I am getting this in 2.0.4.

    The response seems to be related only to bots.

Production build 0.71.5 2024