-
Notifications
You must be signed in to change notification settings - Fork 16
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
Feature/3922 change recaptcha to honeypot #2404
base: develop
Are you sure you want to change the base?
Conversation
without recaptcha, the checking are easy to be by pass. bot can create a account record by request like below.
if we have to remove recaptcha, at least the timer should be server side can not modify by hacker. Recaptcha is not perfect but it is are very good way to against bot. |
@amdomanska I am getting following error when I test at my local. Not sure if it is with my environment. self.hptimer.data is showing as
|
I am using Firefox browser on my mac. I see the latest commit on my system. See the git log below
|
@RK206 I committed the changed to the code.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tested to my best and seems to be working as expected.
Replace Google ReCaptcha with Honeypot.
Please don't delete any sections when completing this PR template; instead enter N/A for checkboxes or sections which are not applicable, unless otherwise stated below
See #3922
Description of Honeypot Technique Implementation
Regarding Google ReCaptcha: the whole code related to it is now removed from the codebase.
General Overview
The Honeypot Technique is a common method used to distinguish between human users and automated bots during form submissions. This technique involves adding a hidden field to the form that is visible to bots but not to human users. The idea is to trap bots that automatically fill in this field, while legitimate users will leave it empty.
To enhance the effectiveness of this technique, we use two key elements:
Implementation Details
email
field has been changed tosender-email
and is placed after the trap.Hiding the Bot-trap Field from Screen Readers and Keyboard Users
The bot-trap field is designed to be hidden from human users while remaining part of the form for detection purposes. To achieve this, we use a combination of CSS properties and HTML attributes to ensure the field is not accessible or visible in various contexts:
Positioning and Size:
position: absolute;
andleft: -9999px; top: -9999px;
: This combination of positioning moves the field far outside the visible area of the browser window. The large negative offset ensures that the field is not within the viewable area of the page.height: 1px; width: 1px;
: These properties reduce the field's size to just 1 pixel by 1 pixel, making it effectively invisible to users while still being part of the document.Visibility:
overflow: hidden;
: This property prevents any content within the field from being displayed outside of its bounds, ensuring no accidental visibility of the field’s content.clip: rect(0, 0, 0, 0);
: This CSS property clips the field’s content to a rectangle of zero width and height, making it invisible and inaccessible, including to screen readers.Additional Reset Properties:
border: 0; padding: 0; margin: 0;
: These properties remove any default styling that could affect the field’s appearance or positioning, ensuring the field does not have any additional spacing or borders.Keyboard Navigation:
tabindex="-1"
: This attribute is used to ensure that the field is not focusable by keyboard navigation. By settingtabindex
to-1
, the field is excluded from the tab order, meaning users cannot accidentally navigate to it using the Tab key. This further ensures that the field is not accessible or interactable by users relying on keyboard navigation.By applying these CSS styles and HTML attributes, the bot-trap field is effectively hidden from both screen and keyboard users. This approach prevents human users from interacting with the field while allowing the honeypot technique to function correctly for detecting automated bots.
Timer Configuration:
Honeypot Validation:
Server-Side Validation:
Unit Tests:
User Notification:
False Positives:
Categorisation
This PR...
Basic PR Checklist
Instructions for developers:
Instructions for reviewers:
Code Style
No deprecated methods are used
No magic strings/numbers - all strings are in
constants
ormessages
filesES queries are wrapped in a Query object rather than inlined in the code
Where possible our common library functions have been used (e.g. dates manipulated via
dates
)Cleaned up commented out code, etc
Urls are constructed with
url_for
not hard-codedTesting
Unit tests have been added/modified
Functional tests have been added/modified
Code has been run manually in development, and functional tests followed locally
Have CSS/style changes been implemented? If they are of a global scope (e.g. on base HTML elements) have the downstream impacts of the change in other areas of the system been considered?
Documentation
FeatureMap annotations have been added
Documentation updates - if needed - have been identified and prepared for inclusion into main documentation (e.g. added and highlighted/commented as appropriate to this PR)
Core model documentation has been added to if needed: https://docs.google.com/spreadsheets/d/1lun2S9vwGbyfy3WjIjgXBm05D-3wWDZ4bp8xiIYfImM/edit
Events and consumers documentation has been added if needed: https://docs.google.com/spreadsheets/d/1oIeG5vg-blm2MZCE-7YhwulUlSz6TOUeY8jAftdP9JE/edit
The docs for this branch have been generated and pushed to the doc site (see docs/README.md for details)
Release Readiness
If needed, migration has been created and tested locally
Release sheet has been created, and completed as far as is possible https://docs.google.com/spreadsheets/d/1Bqx23J1MwXzjrmAygbqlU3YHxN1Wf7zkkRv14eTVLZQ/edit
There has been a recent merge up from
develop
(or other base branch). List the dates of the merges up from develop belowTesting
The best approach is to ask as many people as possible to "register" on the test server and provide feedback on their experience.
Testing Process:
Deployment
What deployment considerations are there? (delete any sections you don't need)
Configuration changes
What configuration changes are included in this PR, and do we need to set specific values for production
Scripts
What scripts need to be run from the PR (e.g. if this is a report generating feature), and when (once, regularly, etc).
Migrations
What migrations need to be run to deploy this
Monitoring
What additional monitoring is required of the application as a result of this feature
New Infrastructure
What new infrastructure does this PR require (e.g. new services that need to run on the back-end).
Continuous Integration
What CI changes are required for this