Commit Graph

21 Commits

Author SHA1 Message Date
lockbitchat
0d7835cfa2 fix: resolve incomplete multi-character sanitization in sanitizeMessage
Use stable replacement loop for all multi-character patterns to prevent malicious input from reappearing after sanitization.
2025-10-20 01:20:02 -04:00
lockbitchat
e209d3e6f5 fix: improve sanitization to prevent XSS
- Now the sanitization function protects against:
  - Nested script tags: <scrip<script>alert("XSS")</script>t>
  - HTML comments containing scripts: <!-- <script>alert("XSS")</script> -->
  - Multiple overlapping tags: <script><script>alert("XSS")</script></script>
  - Attributes in closing tags: </script foo="bar">
  - Complex nested structures combining different tags
  - All known XSS vectors
2025-10-19 23:23:58 -04:00
lockbitchat
49e5a054cb fix: security and build improvements
- Fixed biased cryptographic random with modulo operations
- Corrected biased cryptographic random with addition operations
- Resolved infinite page loading issue
- Rebuilt all distribution files
2025-10-19 23:05:24 -04:00
lockbitchat
5ddfd1f5b3 fix(ios): prevent chat crash when Notifications API is unavailable on iPhones
- Guarded all Notification API usage to avoid ReferenceError on iOS Safari.
- Set default permission to 'denied' when Notification is undefined.
- Added early return in notification flow when Notifications API is unavailable.
- Wrapped Notification.permission, requestPermission(), and new Notification(...) with typeof checks.
- Updated SecureNotificationManager and app.jsx to degrade gracefully.
- Verified build passes and chat loads correctly on iOS without notifications.
2025-10-17 03:49:33 -04:00
lockbitchat
75fa1cd27d Qr generator create bug fix 2025-10-08 01:24:04 -04:00
lockbitchat
65cc136b99 chore: remove debug logging and disable debug mode for production
- Removed temporary console logs used for debugging
- Disabled DEBUG_MODE flag
- Updated configuration to run in production mode
- Cleaned up leftover debug utilities to reduce noise in console
2025-10-02 01:43:32 -04:00
lockbitchat
34094956b7 feat(core): update session, security system and QR exchange
- Removed session creation and Lightning payment logic
- Refactored security system:
  * no more restrictions
  * all systems enabled on session creation
- Improved QR code exchange for mobile devices
2025-09-23 20:01:02 -04:00
lockbitchat
e2316f6557 **What Changed:**
- **Removed:** All libsodium dependencies and PAKE-based authentication
- **Replaced With:** ECDH + DTLS + SAS triple-layer security system
- **Impact:** Eliminates complex PAKE implementation in favor of standardized protocols

**Security Benefits:**
-  **Simplified Architecture** - Reduced attack surface
-  **Standards Compliance** - RFC-compliant protocols
-  **Better Maintenance** - Native Web Crypto API usage
-  **Enhanced Security** - Triple-layer defense system

**New Features:**
- **Elliptic Curve Diffie-Hellman** using P-384 (secp384r1)
- **Cryptographically secure** key pair generation
- **Perfect Forward Secrecy** with session-specific keys
- **MITM resistance** requiring knowledge of both private keys
2025-09-04 17:25:01 -04:00
lockbitchat
77c19c4d71 CRITICAL: Fix major security vulnerabilities
- Remove forced session verification bypass (MITM)
- Implement mandatory file message encryption with AAD
- Add DTLS fingerprint validation and SDP parsing
- Implement hard security gate for unverified connections
- Add emergency key wipe on security breaches
2025-09-01 16:04:33 -04:00
lockbitchat
a4161bc47e SECURITY: Fix console logging vulnerabilities in production mode
- Replace unsafe console.error/warn calls with secure logging system
- Implement production-safe logging that masks sensitive data
- Add automatic sanitization for cryptographic keys and sensitive information
- Create secure logging infrastructure for EnhancedSecureWebRTCManager and EnhancedSecureCryptoUtils
- Prevent data leakage of internal logic and error details in production
- Add production/development mode detection for appropriate logging levels
- Implement server-side error logging for production environments
2025-08-28 15:15:09 -04:00
lockbitchat
e468838596 SECURITY: Fix console logging vulnerabilities in production mode
- Replace unsafe console.error/warn calls with secure logging system
- Implement production-safe logging that masks sensitive data
- Add automatic sanitization for cryptographic keys and sensitive information
- Create secure logging infrastructure for EnhancedSecureWebRTCManager and EnhancedSecureCryptoUtils
- Prevent data leakage of internal logic and error details in production
- Add production/development mode detection for appropriate logging levels
- Implement server-side error logging for production environments
2025-08-28 15:05:42 -04:00
lockbitchat
6aaabbd1df feat(security): Implement full ASN.1 validation for key structure verification
BREAKING CHANGE: Enhanced key validation now performs complete ASN.1 parsing

Security improvements:
- Added complete ASN.1 DER parser for full structure validation
- Implemented OID validation for algorithms and curves (P-256/P-384 only)
- Added EC point format verification (uncompressed format 0x04)
- Validate SPKI structure elements count and types
- Check key size limits to prevent DoS attacks (50-2000 bytes)
- Verify unused bits in BIT STRING (must be 0)
- Added fallback support from P-384 to P-256

This fixes high-risk vulnerability where keys with valid headers but
modified data could be accepted. Now all structural elements are validated
according to PKCS standards.

Affected methods:
- validateKeyStructure() - complete rewrite with ASN.1 parsing
- All key import/export methods now use enhanced validation
2025-08-27 12:39:18 -04:00
lockbitchat
0b01083fce Deleting a test method 2025-08-26 21:36:52 -04:00
lockbitchat
984564fae6 feat: add enhanced security validation and timing protection
Security Enhancements:
- Add salt entropy validation (minimum 16 unique bytes for 64-byte salts)
- Expand secure logging patterns to catch more sensitive data types
  (fingerprint, mac, hash patterns)
- Implement random timing delays in verifyAuthProof() to mask execution timing
- Revert sanitizeMessage() to working regex-based approach

Validation Improvements:
- validateSalt() now checks both size and entropy quality
- secureLog.sanitizeContext() enhanced with additional sensitive patterns
- Added timing attack protection with 5-25ms random delays
2025-08-26 19:58:45 -04:00
lockbitchat
1e270fb4b8 security: fix critical vulnerabilities in crypto module
- Remove insecure key import backdoor
- Strengthen password generation (32 chars + special chars)
- Implement constant-time comparisons to prevent timing attacks
- Fix race conditions in rate limiting with atomic operations
- Add input validation and enhanced error handling

BREAKING CHANGE: Remove allowInsecureImport option - all signed packages
now require mandatory signature verification for security.
2025-08-26 19:44:34 -04:00
lockbitchat
857d7d74ab Encryption module control system & session timer improvements
- Added a real verification system for active encryption modules, giving users full control over enabled modules.
- During session purchase or activation, the actual enabled modules are now displayed for both free and paid sessions.
- Refactored session timer initialization for proper functionality and accurate countdown.
- Optimized code structure related to session management and module verification.
2025-08-17 20:38:47 -04:00
lockbitchat
19e3047282 feat: rebrand to SecureBit.chat due to name conflict
BREAKING CHANGE: Project renamed from LockBit.chat to SecureBit.chat

- Changed project name to avoid confusion with LockBit ransomware group
- Updated all documentation, branding, and references
- Maintained all existing functionality and security features
- Domain migration planned to securebit.chat

Reason: The LockBit name became associated with a notorious ransomware
group, causing conflicts on platforms and potential confusion for users.
SecureBit better reflects our mission of providing secure P2P messaging
while avoiding negative associations.

This change affects:
- README.md and all documentation
- Package.json name field
- Brand assets and logos
- Website references
- Social media handles

Core functionality remains unchanged:
 12-layer military-grade security
 Lightning Network integration
 P2P WebRTC architecture
 Open source MIT license
2025-08-14 15:54:11 -04:00
lockbitchat
79bdcb8c2c 🛡️ MAXIMUM SECURITY P2P CHAT IMPLEMENTATION - STAGE 4 COMPLETE
🚀 Major Security Enhancements:
Implemented world's most secure P2P WebRTC chat with 12-layer security system:

 Triple Encryption Layer: Standard + Nested AES-GCM + Metadata protection
 Perfect Forward Secrecy (PFS): Automatic key rotation every 5 minutes
 ECDH Key Exchange: P-384 curve with non-extractable keys
 ECDSA Digital Signatures: P-384 with SHA-384 for MITM protection
 Enhanced Replay Protection: Sequence numbers + message IDs + timestamps
 Packet Padding: Hide real message sizes (64-512 bytes random padding)
 Anti-Fingerprinting: Traffic pattern obfuscation and size randomization
 Fake Traffic Generation: Invisible decoy messages for traffic analysis protection
 Message Chunking: Split messages with random delays
 Packet Reordering Protection: Sequence-based packet reassembly
 Rate Limiting: 60 messages/minute, 5 connections/5 minutes
 Enhanced Validation: 64-byte salt, session integrity checks

🔧 Critical Bug Fixes:

 Fixed demo session creation error: Resolved cryptographic validation failures
 Eliminated session replay vulnerability: Implemented proper session expiration and unique session IDs
 Fixed fake traffic visibility bug: Fake messages no longer appear in user chat interface
 Resolved message processing conflicts: Enhanced vs legacy message handling
 Fixed security layer processing: Proper encryption/decryption chain for all security features

🎯 Security Achievements:

Security Level: MAXIMUM (Stage 4)
Active Features: 12/12 security layers
Protection Against: MITM, Replay attacks, Traffic analysis, Fingerprinting, Session hijacking
Encryption Standard: Military-grade (AES-256-GCM + P-384 ECDH/ECDSA)
Key Security: Non-extractable, Perfect Forward Secrecy
Traffic Obfuscation: Complete (fake traffic + padding + chunking)

📊 Technical Specifications:
Security Architecture:
├── Layer 1: Enhanced Authentication (ECDSA P-384)
├── Layer 2: Key Exchange (ECDH P-384, non-extractable)
├── Layer 3: Metadata Protection (AES-256-GCM)
├── Layer 4: Message Encryption (Enhanced with sequence numbers)
├── Layer 5: Nested Encryption (Additional AES-256-GCM layer)
├── Layer 6: Packet Padding (64-512 bytes random)
├── Layer 7: Anti-Fingerprinting (Pattern obfuscation)
├── Layer 8: Packet Reordering Protection
├── Layer 9: Message Chunking (with random delays)
├── Layer 10: Fake Traffic Generation (invisible to users)
├── Layer 11: Rate Limiting (DDoS protection)
└── Layer 12: Perfect Forward Secrecy (automatic key rotation)
🛡️ Security Rating:
MAXIMUM SECURITY - Exceeds government-grade communication standards
This implementation provides security levels comparable to classified military communication systems, making it one of the most secure P2P chat applications ever created.

Files Modified:

EnhancedSecureWebRTCManager.js - Complete security system implementation
EnhancedSecureCryptoUtils.js - Cryptographic utilities and validation
PayPerSessionManager.js - Demo session security fixes

Testing Status:  All security layers verified and operational
Fake Traffic Status:  Invisible to users, working correctly
Demo Sessions:  Creation errors resolved, replay vulnerability patched
2025-08-14 03:28:23 -04:00
lockbitchat
77ff67d2be Updated all text to English 2025-08-13 22:37:21 -04:00
lockbitchat
f6683f1533 Updated all text to English 2025-08-12 15:43:35 -04:00
aegisinvestment
f07e8400cf First commit - all files added 2025-08-11 20:52:14 -04:00