1

I am reading/implementing a RESTful API design, where the author has stated that regex can be used in the query param as part of filtering.

For example:

https://example.com/users?name=/bil?li/

From various articles on ReDoS, I can't help to think that this is not a very good idea because I don't believe there is a sane way to do validation and whitelisting on the incoming regex. And the datastore/database could suffer heavy penalties.

So if this requirement is part of an API spec, that I have no control over, how would I safely implement this feature?

I would be using Express.js

Bill
  • 3,059
  • 3
  • 31
  • 47

0 Answers0