Skip to content

v0.3.0

Choose a tag to compare

@stevedoyle stevedoyle released this 22 Jul 16:33
· 5 commits to main since this release
8646e7f

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

⚠️ Important: This release includes breaking changes for security reasons

  1. Configuration Validation: Files with SPI=0 are now rejected
  2. Random Initialization: PktContext::new() generates random keys (not zeros)
  3. 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 testing

For configuration files:

  • Replace any SPI=0 values 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 security
  • PspConfig::new_secure() - Create secure configurations with validation
  • PktContext::new_for_testing() - Predictable initialization for tests
  • PktContext::generate_secure_key() - Generate cryptographically secure keys
  • PktContext::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_tests

All 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.