Needs review
Project:
Antibot
Version:
3.0.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
6 Dec 2023 at 12:35 UTC
Updated:
7 Nov 2025 at 11:07 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
glugmeister commentedComment #3
glugmeister commentedI noticed a comment typo in the first patch uploaded. Here's another one.
I also didn't explain all the changes I have made in this patch.
The original JS had event listeners to detect humans for mousemove, touchmove and keydown (with a further check that key pressed was tab or enter). The patch changes mousemove to pointermove and adds an additional listener for pointerdown so that if a user clicks submit without mouse movement, the mouse click is detected and antibot protection on the form is unlocked and submission proceeds.
Pointermove and pointerdown events cover both mouse and touch input events. So there is no need for a separate touchmove event listener and it is removed.
In relation to the keydown event, I have removed the check for tab or enter keys because it is possible for keyboard users to use space to activate a button. I then thought why not allow any key press to detect a human?
I have added an additional check for all event listeners to check the Event.isTrusted property is set to true. The browser sets this when an event is triggered by a user as opposed to being triggered programmatically by Javascript. In theory, I was thinking this would be a good extra check to prevent form submissions by more sophisticated bots using a headless browser (with Javascript enabled) to simulate mouse, touch or keyboard events. I have not tested this theory though ...
Comment #5
itmaybejj commentedI found additional problems that block disabled users, stemming from the same cause.
I pulled your patch into an issue fork and added some more:
One possible remaining task...I'm not passing admin-overridden config through translation, as that would strip links. This is not a regression per se as the default is your current text, which is still being translated. Not sure what makes sense there unless someone knows a way to pass user generated content with links through translation -- restricting links, restricting translation, exposing a user preference?
Comment #6
itmaybejj commentedComment #8
itmaybejj commentedComment #9
itmaybejj commentedComment #10
the_g_bomb commentedComment #11
itmaybejj commentedAnother way to address the accessibility issue may be to have some sort of "are you a human" field that a user can interact with, and disabling the submit button until the user has passed any tests.
Comment #12
itmaybejj commentedComment #13
rkollerComment #14
rkollerComment #15
pameeela commentedThis is just captcha though, right? The idea is to avoid having to interact.
I'm adding the target tag to track this one, and I think if we can't resolve it we'll remove the module from Drupal CMS until a solution can be found. It seems like a edge case but it renders the form unusable so it's fairly serious.
Comment #16
phenaproximaTagging this as a Drupal CMS dependency critical, because it is severe enough that we need to remove Antibot from our dependencies, for now (see #3498392: Remove Antibot module because of unaddressed accessibility issues) until this issue is fixed and in a tagged release of Antibot. :(
Comment #17
gaurav.kapoor commented@glugmeister @itmaybejj Thanks for using Antibot and working on this issue. Are you still able to reproduce the issue with the latest 2.0.4 release? I created a multi-step web form, followed the steps mentioned in the issue and then used Apple voiceover to make submission and it was not blocked by Antibot. Possible to share any other inputs that might help others reproduce the issue? Thanks.
Comment #20
jan kellermann commentedThe solution of allowing clicks and querying the isTrusted attribute can significantly reduce the effectiveness of the module. We have therefore created a new merge request that adds an adjustable time component (default 5 seconds) to the click event.
Please review / feedback.
Comment #21
danrodI tested the original bug regarding the mouse pointer and I got the same error:
I had some issues applying the patch # 3, but It seemed to fix the issue
I'll look into the accessbility issues now.
Comment #22
danrodI'm using Linux here and the default screen reader that comes with it (Orca) is just a nightmare and I can't submit/navigate the form unless I use the tab and hit enter to submit the form, I believe JAWS has the option to navigate the webform without the tab, I'll ask one of my colleagues who uses Windows if he can do some tests with JAWS.
Comment #24
gaurav.kapoor commentedComment #25
jan kellermann commented@danrod: Thank you for testing. The patch
antibot-issue-3406484-2.patchyou used is almot 13 months old. Please test with current issue fork.I changed the test to fill in the form data via JS instead of using Mink because Mink simulates the keystroke events.
Comment #26
jan kellermann commentedIn general the scope of this issue moved. The webform-bug seems to be fixed without this issue.
Interesting is comment #5 where several new a11y problems are mentioned that call into question the functioning of the module in general for accessibility reasons.
The MR!23 tries to solve this problems and attempts to balance accessibility and spam protection.
Comment #27
jan kellermann commentedFor testing you can use the
/user/passwordpage without further config (only enable antibot) and I uploaded webform.webform.test_3406484.yml which you may import and use for multi-page webform tests.Comment #28
the_g_bomb commentedI agree the scope has changed somewhat.
I retested the issue after comment #17 and was not able to reproduce the issue with the latest 2.0.4 release using a keyboard only. I haven't been able to test with no keyboard, no mouse movements except a submit button click as my testing screen doesn't support that, I'll try on a larger screen asap.
I will also try to test the MR additions. Thank you
Comment #29
danrodHello @jan kellermann can you share with me how to use Mink to test this MR? I'm not familiar with Mink and I'ld like to help on this.
Comment #30
jan kellermann commentedBehat/Mink is predefined in Drupals PHPunit-Config. For local testing you need a chromium. We are running this via docker, see here.
See also this pipeline (line 68ff)
See also this commit.
Comment #31
alvar0hurtad0Comment #32
gaurav.kapoor commentedComment #33
gaurav.kapoor commentedBased on the discussion around the issue during the contribution event, the change can have a major impact on the accessibility, security, and overall working of the module so it will be better to have a separate release at the moment. This will help in gathering more feedback and based on that in the future we can either have one release or multiple releases maintained in parallel. Congratulation
Comment #34
danrodThank you @gaurav.kapoor , It is a shame that I wasn't able to work on this issue closely, I had some work commitments on the side, but I'll look into the other issues from time to time.
Will the 3.0.x branch have the release with the accessbility features/fixes?
Comment #35
gaurav.kapoor commented@danrod, no worries, I can take up this one. Plan at the moment is to have fixes from this issue in 3.0.x and a release after some more testing. But we continue to maintain 2.0.x and have a release as well with some of the recent fixes. In future, we can again switch to a single supported release and active development branch.
Comment #36
berdirA client we have is still seeing this on multi-page forms, as regular users, without any assistive technology.
I assume this only happens on subsequent steps. Could we set a flag in local storage or something like once user successfully passed the check and immediately unlock the form for them for any future request, possibly for a given period of time?