Repository navigation
v0.3.0
PSP Security v0.3.0 - Major Security Release 🔒
This is a major security release that addresses critical vulnerabilities and introduces important security improvements. All users are strongly encouraged to upgrade.
🚨 Critical Security Fixes
Resolved Vulnerabilities
- [CRITICAL] Exposed real cryptographic keys in example configuration files
- [HIGH] Insecure zero-key initialization in
PktContext::new() - [HIGH] Missing input validation allowing weak configurations
- [MEDIUM] Panic-prone error handling with
unwrap()calls
Security Enhancements
- ✅ Secure Key Generation: All keys now use cryptographically secure random generation
- ✅ Configuration Validation: New
PspConfig::validate()method detects weak keys and invalid parameters - ✅ Input Sanitization: Comprehensive validation for configuration files and packet parameters
- ✅ Attack Surface Reduction: Removed unused dependencies
- ✅ Security Testing: Added 12 comprehensive security unit tests
🔄 Breaking Changes
- Configuration Validation: Files with
SPI=0are now rejected - Random Initialization:
PktContext::new()generates random keys (not zeros) - Strict Parsing: Configuration files must pass security validation
Migration Guide
For existing code:
// OLD (insecure)
let ctx = PktContext::new(); // Now generates random keys
// NEW (for tests)
let ctx = PktContext::new_for_testing(); // Predictable values for testingFor configuration files:
- Replace any
SPI=0values with valid non-zero SPIs - Ensure all master keys are not all zeros or repeating patterns
📊 What's New
New APIs
PspConfig::validate()- Validate configuration securityPspConfig::new_secure()- Create secure configurations with validationPktContext::new_for_testing()- Predictable initialization for testsPktContext::generate_secure_key()- Generate cryptographically secure keysPktContext::generate_secure_spi()- Generate secure SPI values
Improved Error Handling
- Replaced panic-prone
unwrap()calls with proper error propagation - Enhanced error messages with contextual information
- Better validation error reporting
Security Testing
- 12 new security-focused unit tests
- Key generation uniqueness validation
- Configuration security validation
- Weak key detection testing
🛡️ Security Impact
This release eliminates several classes of vulnerabilities:
- Key Exposure: No more real keys in example files
- Weak Cryptography: Prevention of zero/weak key usage
- Configuration Attacks: Validation prevents malicious configs
- Denial of Service: Robust error handling prevents panics
📈 Compatibility
- Unit Tests: All 35 tests pass (including 12 new security tests)
- API Compatibility: Core APIs remain unchanged for secure usage patterns
- Documentation: All doc tests continue to pass
🔍 Verification
You can verify the security improvements by running:
cargo test security_testsAll security tests should pass, demonstrating the effectiveness of the implemented protections.
Full Changelog: v0.2.2...v0.3.0
Upgrade Priority: 🔥 HIGH - Contains critical security fixes
For questions or concerns about this security release, please open an issue on GitHub.