Skip to content

Submitting a protected form using javascript breaks captcha #359

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
den1251 opened this issue Dec 22, 2024 · 2 comments
Closed

Submitting a protected form using javascript breaks captcha #359

den1251 opened this issue Dec 22, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@den1251
Copy link

den1251 commented Dec 22, 2024

Describe the bug
When I add a js code which prevents form from submitting, executes a function and after that submits. The website returns (client side) (Hidden field captcha) This field is required.. Script part of that I use (the one that messes up the captcha) is written below

    document.getElementById("referat").addEventListener("submit", async function(e) {
            e.preventDefault();
            var hiddenInput = document.createElement("input");
            hiddenInput.type = "hidden";
            hiddenInput.name = "late_fingerprint";
            hiddenInput.id = "late_fingerprint";
            document.getElementById("referat").appendChild(hiddenInput);
            await generateFingerprint("late_fingerprint");
            console.log("Late Fingerprint Value: ", document.getElementById("late_fingerprint").value);
            this.submit();
        });

To Reproduce
Steps to reproduce the behavior:
Add to your js prevention of submission of a captcha protected form (wait for some function to complete) after that submit from the js

Expected behavior
Recaptcha will be alright with that

Screenshots
image

Desktop (please complete the following information):

  • OS: Linux
  • Browser Firefox
@den1251 den1251 added the bug Something isn't working label Dec 22, 2024
@den1251
Copy link
Author

den1251 commented Dec 23, 2024

Adding grecaptcha.execute() in the js before it submits the form solves the issue

@den1251 den1251 closed this as completed Dec 23, 2024
@Stormheg
Copy link
Contributor

Hello @den1251 - glad to see you already found a workaround. For what is worth, this sounds like a duplicate of #348

This is something we broke and I believe should be fixed. Just not sure yet how. #348 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy