We have a few protections but should expand our scope. Currently we have two small fixes
- limiting query length
- this happens both on the search input & the URL query.
searchQuery.tsx errors when URL query is longer than the MAX_QUERY_LENGTH
- search page getData injects cleaned query from our
utils.ts file safeQuery
- search input itself has char limit from
MAX_QUERY_LENGTH in <SajeonSearch/>
However, we should also add rate limiting to prevent excessive calls to any search endpoint and consider another validator to check our regex excape like validator from NPM https://www.npmjs.com/package/validator (e.g. escape())
extra details in notion
We have a few protections but should expand our scope. Currently we have two small fixes
searchQuery.tsxerrors when URL query is longer than theMAX_QUERY_LENGTHutils.tsfilesafeQueryMAX_QUERY_LENGTHin<SajeonSearch/>However, we should also add rate limiting to prevent excessive calls to any search endpoint and consider another validator to check our regex excape like
validatorfrom NPM https://www.npmjs.com/package/validator (e.g.escape())extra details in notion