Security fixes#1
Open
sanvviratthore wants to merge 17 commits into
Open
Conversation
- Removed shell command execution with user input - Sanitized filename to alphanumeric characters only - Used fs operations instead of exec() - Severity: CRITICAL
- Added filename sanitization - Validated path stays within backups directory - Prevented directory traversal attempts - Severity: CRITICAL
- Whitelisted only 'email' and 'username' fields - Prevented role and password modification via profile update - Added email validation - Severity: HIGH
- Removed mass assignment vulnerability - Only role field can be updated via this endpoint - Severity: HIGH
- Added authentication requirement to list users (admin only) - Added authentication to view user details - Users can only view own profile unless admin - Removed password hash from response - Severity: HIGH
- Added ownership verification before update - Users can only update their own notes - Severity: HIGH
- Explicitly specified HS256 algorithm - Prevents 'none' algorithm bypass - Severity: HIGH
- Removed default weak secrets - Require JWT_SECRET in environment - Updated .env.example with strong placeholders - Severity: HIGH
- Changed from wildcard (*) to whitelist - Added environment variable for allowed origins - Severity: MEDIUM
- Added username and password validation - Enforces strong password requirements - Severity: MEDIUM
- Added Helmet middleware for security headers - Protects against common web vulnerabilities - Sets Content-Security-Policy, X-Frame-Options, etc.
- Added rate limiter to /auth/register - Prevents account spam and enumeration - Severity: LOW
- Replaced basic regex with DOMPurify library - Improved filename sanitization - Severity: MEDIUM
- Added Snyk security scanning - Generated npm audit report - Both show 0 vulnerabilities
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Security Fixes Summary
Fixed all identified vulnerabilities:
All fixes verified and tested. Application remains fully functional.
See AUDIT.md for complete security report.