-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
[BUG] User sign up with POST request to the API #803
Comments
We can implement a Rate limiter in the back-end using the token given to the |
@pc9795 we recently implemented re-captcha for the editor and re-captcha seems like the best way to do this. Would you consider a simple re-captcha implementation? |
Recaptcha will protect us from the in-app requests but what about machine clients (like cURL, Postman etc)? |
@pc9795 We actually recently learnt that re-captcha is a backend protection mechanism. It sends the backend a token that is generated by the re-captcha library and the token has to be verified by a google API. |
Oh! If we are implementing the re-captcha token validation in the backend then it works fine. I just had seen this on client-side that's why I was confused 👍 |
If we have implemented it then we can close this issue. |
@pc9795 it's not implemented yet. Would you like to pick this up? |
I will have a look 👍 |
Hi @Nikhil-Nandagopal, Can I take it up if it is available ? |
Hey @sumitsum, are you working on this issue? If not, can I take this over? I have gone through the codebase to understand the flow for this issue. In As per above flow Question: I don't know where If we only want to add recaptcha for signup flow, I feel Ideally, a middleware (using annotation) should be used to keep it extensible for all methods in future (i.e. login, password change etc). I am new to Java, please correct me if I get terminologies wrong. |
Hey @monarch0111, you're on the right track. Only change I'd suggest is instead of an annotation, let's just have a service class called Check out this link: https://www.baeldung.com/spring-security-registration-captcha#Retrieve-ResponseToken. This suggests a way of doing the check in the request handler method and then proceeding to rest of the implementation. It'll be slightly different in our case since Appsmith's codebase is reactive in nature, but this should get you started. The rest of this article can also serve as a starting point for an implementation of the validator service. Do reach out here if you get stuck somewhere or need a pointer in the codebase itself. Good luck 👍 and thanks for your contributions 🙏! |
@sharat87 Thanks for the insights. I have done a basic implementation (not tested well, though). monarch0111#1 It needs to be refined and worked on, I will raise a PR on this repo once done. |
Will there be a way to bypass/mock the recaptcha as well? I'm asking this because a few deployments (like AWS AMI) create a default admin user. Also our Cypress tests create test user accounts for each test. I would like to ensure that there's a way to either bypass or mock re-captcha invocations to ensure that we don't end up breaking any of these tests or self-hosted instances. |
@mohanarpit I have defined an interface, which should allow us to mock this. In case secret key is not defined, it will always return true as per current implementation. |
Description
I've just sent a POST request using Postman to with plain text JSON Body and boom! Account is created.
Request URL: https://app.appsmith.com/api/v1/users
Request: http://prntscr.com/uokz6z
What could go possibly wrong with this approach?
I can simply write a loop that runs probably a 1000 times or 1000...n times and create users with a simple cURL call and random emails and flood the database.
What are the ways to fix this
Add security to disable API based user creation and also add either a reCAPTCHA or a layer of security to verify if it is an actual user signing up.
Important Details
The text was updated successfully, but these errors were encountered: