test: Add 8 and update 14 files
Some checks failed
Build-Test-Publish / build (linux/amd64) (push) Failing after 22s
Build-Test-Publish / build (linux/arm64) (push) Failing after 32s
Build-Test-Publish / create-manifest (push) Has been skipped

This commit is contained in:
Your Name
2025-08-10 21:18:40 +12:00
parent 1fed086348
commit 8ab6028597
22 changed files with 1392 additions and 81 deletions

View File

@@ -9,28 +9,25 @@ This comprehensive security review analyzes the Simple Object Server C++23 appli
## Critical Issues (MUST FIX)
### 1. **Hardcoded Authentication Tokens in Test Configuration**
- **Location**: `testing/sos_config.json:2-6`
- **Risk**: CRITICAL - Exposed authentication tokens in repository
- **Issue**: Test configuration contains hardcoded plaintext tokens ("fizzle1", "fizzle2", "fizzle3")
- **Evidence**: Tokens visible in version control history
- **Recommendation**:
- Remove hardcoded tokens from repository immediately
- Use environment variables or external configuration
- Add `sos_config.json` to `.gitignore`
- Provide a `sos_config.json.example` template instead
- Rotate all existing tokens
### 1. **~~Hardcoded Authentication Tokens in Test Configuration~~ [FIXED]**
- **Location**: ~~`testing/sos_config.json:2-6`~~ File removed
- **Risk**: ~~CRITICAL~~ RESOLVED - No longer exposed in repository
- **Fix Implemented**:
- Removed hardcoded `sos_config.json` from repository
- Added to `.gitignore` to prevent accidental commits
- Created `sos_config.json.example` template
- Test scripts now generate random tokens for each test run
- Added `generate_test_config.sh` for dynamic token generation
### 2. **No Token Hashing/Encryption**
- **Location**: `src/server.cpp:70`
- **Risk**: CRITICAL - Tokens stored and compared in plaintext
- **Issue**: Authentication tokens are stored in memory and compared directly as strings
- **Impact**: Token compromise exposes actual credentials
- **Recommendation**:
- Implement token hashing using bcrypt or argon2
- Store only hashed tokens in configuration
- Hash incoming tokens before comparison
- Consider implementing JWT or OAuth2 for better security
### 2. **~~No Token Hashing/Encryption~~ [FIXED]**
- **Location**: `src/server.cpp:70-91`
- **Risk**: ~~CRITICAL~~ RESOLVED - Tokens now use bcrypt hashing
- **Fix Implemented**:
- Added bcrypt implementation in `src/bcrypt.hpp`
- Server now verifies tokens against bcrypt hashes only
- Created `hash_token` utility for generating secure hashes
- Removed all plaintext token support for enhanced security
- **Documentation**: See README.md for token hashing instructions
### 3. **Weak Cryptographic Hash for Content**
- **Location**: `src/hash.cpp:12-56`
@@ -192,8 +189,8 @@ class AuditLogger {
## Priority Action Items
1. **CRITICAL - Immediate**:
- Remove hardcoded tokens from repository
- Implement token hashing
- ~~Remove hardcoded tokens from repository~~ ✅ COMPLETED
- ~~Implement token hashing~~ ✅ COMPLETED
- Replace XXHash with SHA-256 for content identification
2. **HIGH - Before Public Release**: