Skip to content
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

ever growing provider_requests table in auth schema #455

Open
saibs opened this issue Dec 19, 2023 · 2 comments
Open

ever growing provider_requests table in auth schema #455

saibs opened this issue Dec 19, 2023 · 2 comments

Comments

@saibs
Copy link

saibs commented Dec 19, 2023

We are self hosting hasura auth, we noticed recently that lots of entries are created in provider_requests table in auth schema and keeps on growing because of this request triggered in the oauth middleware responsible in creating the session.
Note: we are not using any oauth provider as a signin method.

I think this is happening since this commit
the healthz endpoint moved to app level and every call to healthz endpoint creates an entry in provider_requests table because of the above express middleware.

Steps to reproduce

  • Make sure you are running the auth service without any AUTH_API_PREFIX
  • Make a call to /healthz endpoint, which triggers oauth middleware and creating an entry in provider_requests table

tested on version: 0.24.0
related discord discussion

@dbarrosop
Copy link
Contributor

dbarrosop commented Dec 19, 2023

Ok, I could reproduce with an empty AUTH_API_PREFIX. If you have a solution that doesn't involve changing current behavior a PR is more than welcomed. Otherwise we will try to take a look when we have the time.

Note to interested parties: This doesn't affect nhost-managed instances.

@saibs
Copy link
Author

saibs commented Dec 19, 2023

one easy solution by not affecting current behavior would be to hoist the /healthz endpoint check above the app usage of router

but this would still be a vulnerability as one can create lots of entries in the database by just calling random routes which are 404, because of this catch all route and would create sessions with null values in provider_requests table

@saibs saibs closed this as completed Dec 19, 2023
@saibs saibs reopened this Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants