Sanitize User Input for MongoDB Regex Queries in Search and ListAll Endpoints

Prevent application crashes caused by invalid regular expression patterns (e.g., *, +, (), etc.) in user-provided input used in MongoDB $regex queries.

Apply sanitization to all search and listAll endpoints across the application that use MongoDB $regex.

Ensure consistent handling of special characters in user input to avoid MongoServerError: quantifier does not follow a repeatable item.



Solution



Domain
General
Action
fix
Department
Backend

Please authenticate to join the conversation.

Upvoters
Status

Completed

Board
🛠️

Bug & Fixes

Tags

High Priority

Date

10 months ago

Author

Piyush Patel

Subscribe to post

Get notified by email when there are changes.