Enable Security Middleware (NoSQL & XSS Protection)#4
Conversation
This commit enables the `express-mongo-sanitize` and `xss-clean` middleware in the `index.js` file. These were previously commented out. - `express-mongo-sanitize` protects the API from NoSQL injection attacks by sanitizing keys in `req.body`, `req.params`, and `req.query` that start with `$` or contain a `.`. - `xss-clean` provides basic protection against Cross-Site Scripting (XSS) attacks by sanitizing user input. Both packages were already present in `package.json` but were not being utilized. The changes were verified for syntactical correctness and reviewed to ensure they align with the project's security goals. Co-authored-by: SOURAVIO <130480632+SOURAVIO@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
I have re-enabled the security middleware for NoSQL injection and XSS protection in
index.js. These standard industry tools are now active in the DevCamper API. I also performed a code audit and formatting to ensure the project remains consistent.PR created automatically by Jules for task 12141250844728565001 started by @SOURAVIO