gorkem-bwl
|
8b322a0ec0
|
feat: apply input sanitization to prevent XSS attacks
Enables comprehensive XSS protection by applying sanitization middleware
to all incoming requests. Uses the sanitization utilities added in previous PR.
Changes:
- Added sanitizeBody() and sanitizeQuery() middleware after express.json()
- Enhanced Content Security Policy headers for additional XSS protection
- Added 'object-src: none' and 'base-uri: self' directives
- All user inputs now automatically sanitized before processing
Security improvements:
- Prevents stored XSS attacks through HTML sanitization
- Recursive sanitization handles nested objects and arrays
- Maintains backward compatibility with existing functionality
- Strengthened CSP headers block unsafe content injection
Files changed: src/app.js (9 lines added)
Risk level: Medium (global middleware application)
|
2025-08-11 17:33:05 -04:00 |
|