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

mongo definition store regex protection #243

Open
jeffmcaffer opened this issue Oct 4, 2018 · 2 comments
Open

mongo definition store regex protection #243

jeffmcaffer opened this issue Oct 4, 2018 · 2 comments

Comments

@jeffmcaffer
Copy link
Member

in mongo.js the list method takes coordinates from the user, constructs a regex and runs it in mongo. We should look to see if that needs protection against DoS attacks (does mongo/cosmosdb already handle this somehow), should we check anyway?

@moranthomas
Copy link
Contributor

General Guidelines:

Prevent query injection attacks

  1. Always make use of a library (e.g. mongoose) that sanitizes data - they have built-in protection against injection attacks
  2. Never use the $where operator. 
  3. Accept only strings from your users (never objects by design) 
  4. The fact that these are EntityCoordinates means that they are already well defined and tightly constrained objects, however

Avoid DOS attacks by explicitly setting when a process should crash

  1. The Node process will crash when errors are not handled.
  2. Alert with critical severity anytime a process crashes due to an unhandled error
  3. Validate the input and avoid crashing the process due to invalid user input
  4. Wrap all routes with a catch

@dabutvin
Copy link
Member

dabutvin commented Feb 7, 2019

@fossygirl fossygirl removed this from the December 2018 milestone Feb 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants