You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks again for tackling these security improvements — the intent is right, but there are few blockers before this can land:
PBKDF2 migration is missing. Bumping iterations to 100,000 and switching to SHA-256 will lock out every existing user on upgrade. The SECURITY.md states passwords migrate on next login, but there's no fallback logic in the code that I see. You'll need a "try new params → fail → retry old params → re-hash on success" path in authenticateFactor1.
timingSafeEqual in security_util.js is less safe than what's already in the code. The early return on length mismatch leaks token length via timing. The existing crypto.timingSafeEqual usage in user.js is already correct for this purpose.
validateFilePath will break file operations, unfortunately: Using process.cwd() as the base dir rejects every legitimate archive path outside the process directory (i.e. all of the file base). The hardcoded /root block also breaks installs under /root/enigma-bbs. Similarly, validateCommandArgs blocks valid filenames. Since pty.spawn takes an args array rather than a shell string, shell metacharacter injection isn't possible at that layer — but the check will reject legitimate filenames containing parentheses.
HSTS needs to be be conditional on TLS. Sending Strict-Transport-Security on plain HTTP responses will brick browser access to non-TLS installs for a year.
The token expiration (24h), rate limiting on password reset, and body size cap are all solid additions worth keeping. Happy to discuss any of these in more detail!
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
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 Improvements Summary
Quick Reference
This document provides a quick reference for the security improvements implemented in ENiGMA½ BBS.
Files Modified
Files Created
Key Improvements at a Glance
🔐 Cryptography
🛡️ Input Validation
⏱️ Rate Limiting
🚫 Attack Prevention
🌐 HTTP Security
Usage Examples
Using Security Utilities
Testing Commands
Configuration
Rate Limiting (Optional Tuning)
Edit
core/web_password_reset.js:Security Headers (Optional Customization)
Edit
core/security_util.js-getSecurityHeaders()function:Security Checklist
Implementation ✅
Testing ✅
Documentation ✅
Impact Assessment
Security
Performance
Compatibility
Migration Notes
For End Users
For Administrators
For Developers
Common Issues & Solutions
Issue: "Rate limit exceeded" messages
Solution: This is working as intended. Adjust limits in
web_password_reset.jsif too restrictive.Issue: "Invalid file path" errors
Solution: Check that paths don't contain
..or absolute system paths.Issue: "Invalid command arguments" errors
Solution: Ensure command arguments don't contain shell metacharacters.
Future Enhancements
Support & Questions
References
Version: 1.0.0
Date: October 25, 2025
Author: Security Audit Team