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

validateWebhook is subject to OOM attacks #262

Open
sk- opened this issue Apr 7, 2020 · 0 comments
Open

validateWebhook is subject to OOM attacks #262

sk- opened this issue Apr 7, 2020 · 0 comments

Comments

@sk-
Copy link

sk- commented Apr 7, 2020

validateWebhook adds the token to the list of seen ones, before validating the token is valid. This means an attacker could repeatedly send invalid requests to the server and trigger an OOM. Furthermore the attacker could send a large enough token, and trigger the OOM more quickly.

Also, in order to limit the memory consumption I'd either:

  • use a lru-cache
  • allow to configure mailgunExpirey to a lower value

First option may accept the same request twice, but is the safest to prevent excessive memory usage in case of high traffic. The size could be a config.

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

1 participant