Skip to content

Conversation

100NikhilBro
Copy link
Contributor

Security Improvement Suggestion #57

Suggestion:
Implement sanitize-html middleware to clean user inputs.

Why?

  • Prevents XSS (Cross-Site Scripting) attacks by sanitizing HTML inputs.
  • Ensures only safe HTML tags and attributes are allowed.

Implementation Details:

  • Created a central sanitizeMiddleware.js.
  • Middleware sanitizes req.body, req.params, and req.query.
  • Integrated middleware globally in server.js before routes.

Testing / Usage:

  • All endpoints now sanitize HTML inputs automatically.
  • Tested with nested objects and arrays to ensure complete sanitization.

Copy link

netlify bot commented Oct 8, 2025

Deploy Preview for paisable ready!

Name Link
🔨 Latest commit 609b49f
🔍 Latest deploy log https://app.netlify.com/projects/paisable/deploys/68e7d7f5c792eb0008d08740
😎 Deploy Preview https://deploy-preview-100--paisable.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 90
Accessibility: 100
Best Practices: 100
SEO: 91
PWA: 80
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@100NikhilBro
Copy link
Contributor Author

Hi @archa8 @Avdhesh-Varshney,
I’ve made the changes and pushed the PR. Please take a look and let me know if any improvements are needed.

@archa8 archa8 linked an issue Oct 8, 2025 that may be closed by this pull request
Copy link
Member

@Avdhesh-Varshney Avdhesh-Varshney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@100NikhilBro
Copy link
Contributor Author

Hi @Avdhesh-Varshney @archa8 👋, just checking — is the PR ready to be merged, or do you need any updates from my side? I noticed it’s approved but not yet merged, so just wanted to confirm if there’s any issue with the code. 😊

Copy link
Member

@archa8 archa8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@archa8
Copy link
Member

archa8 commented Oct 9, 2025

Hey @100NikhilBro, actually your PR branch is behind the base (master) branch. Please update your branch with the latest master so we can merge.

@100NikhilBro
Copy link
Contributor Author

Hi @archa8 I’ve synced my branch with the latest master. Please verify once and proceed with the merge when convenient.

@archa8 archa8 merged commit 7492748 into Code-A2Z:master Oct 9, 2025
4 checks passed
@archa8
Copy link
Member

archa8 commented Oct 9, 2025

Merged! Thank you for your contribution @100NikhilBro.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

enhancement: Security Improvement Suggestion for HTML inputs

3 participants