Skip to content

Security: firebitsbr/Houdinis

Security

docs/SECURITY.md

Houdinis Framework - Security Documentation

Security Improvements and Vulnerability Fixes

This document outlines the comprehensive security improvements made to the Houdinis Framework.

Critical Vulnerabilities Fixed

1. Input Validation Vulnerabilities

  • Issue: Raw input() calls without validation
  • Fix: Implemented secure input handling with getpass for sensitive data
  • Files: quantum/backend.py, auxiliary/quantum_config_old.py, core/cli.py
  • Security Impact: Prevents credential exposure and input injection

2. Command Injection Prevention

  • Issue: Lack of command input validation
  • Fix: Added regex-based command validation and sanitization
  • Files: core/cli.py, main.py
  • Security Impact: Prevents arbitrary command execution

3. Path Traversal Protection

  • Issue: Insufficient file path validation
  • Fix: Implemented secure file operations with path validation
  • Files: security/secure_file_ops.py
  • Security Impact: Prevents unauthorized file access

4. Database Security

  • Issue: SQL injection vulnerabilities and insecure database operations
  • Fix: Added parameterized queries, constraints, and secure permissions
  • Files: exploits/tls_sndl.py
  • Security Impact: Prevents SQL injection and unauthorized data access

5. Network Security

  • Issue: Insufficient input validation for network operations
  • Fix: Added hostname/IP validation and secure socket handling
  • Files: exploits/ssh_quantum_attack.py, scanners/network_scanner.py
  • Security Impact: Prevents network-based attacks

New Security Features

1. Security Configuration Module

  • File: security/security_config.py
  • Features:
    • Centralized security validation
    • Input sanitization functions
    • Secure logging capabilities
    • Quantum vulnerability assessment
    • Token validation

2. Secure File Operations

  • File: security/secure_file_ops.py
  • Features:
    • Path traversal protection
    • Secure file permissions (0o600)
    • Atomic file operations
    • Secure file deletion with overwriting
    • File size limits and validation

3. Enhanced Logging

  • Features:
    • Security event logging
    • Sensitive data hashing for logs
    • Secure log file permissions
    • Comprehensive audit trail

Security Best Practices Implemented

1. Input Validation

# Before
token = input("Enter token: ")

# After
import getpass
token = getpass.getpass("Enter token (hidden): ")
if not SecurityConfig.validate_token(token):
    return False

2. Secure File Handling

# Before
with open(file_path, 'w') as f:
    f.write(data)

# After
secure_files = SecureFileOperations()
success = secure_files.secure_write_file(file_path, data, mode=0o600)

3. Command Validation

# Before
line = input(prompt)

# After
line = input(prompt).strip()
if not SecurityConfig.validate_command(line):
    print("[!] Invalid command")
    continue

Security Configuration

File Permissions

  • Database files: 0o600 (owner read/write only)
  • Log files: 0o600 (owner read/write only)
  • Configuration files: 0o600 (owner read/write only)
  • Temporary directories: 0o700 (owner access only)

Input Limits

  • Maximum input length: 1000 characters
  • Maximum filename length: 255 characters
  • Maximum command length: 500 characters
  • Maximum file size: 100MB

Network Security

  • Hostname validation with regex patterns
  • Port validation (1-65535)
  • Socket timeout enforcement (10 seconds)
  • Response size limits

Dependency Security

Updated Requirements

  • cryptography>=41.0.0 - Latest security patches
  • pycryptodome>=3.19.0 - Secure cryptographic operations
  • validators>=0.22.0 - Input validation
  • bleach>=6.0.0 - HTML sanitization

Quantum Security Assessment

The framework now includes quantum vulnerability assessment for:

  • RSA encryption (HIGH risk)
  • DSA signatures (HIGH risk)
  • ECDSA signatures (HIGH risk)
  • DH key exchange (HIGH risk)
  • AES-128 (MEDIUM risk)
  • Hash functions (varies)

Security Testing

Validation Tests

# Run security validation tests
python security/security_config.py

# Run secure file operations tests
python security/secure_file_ops.py

Security Checklist

  • All user inputs validated
  • File operations use secure paths
  • Database queries parameterized
  • Network inputs validated
  • Sensitive data handled securely
  • Proper error handling implemented
  • Security events logged
  • File permissions set correctly

Responsible Disclosure

This framework is designed for:

  • Educational purposes
  • Authorized security testing
  • Post-quantum cryptography research
  • Vulnerability assessment (with permission)

Legal Compliance

Users must:

  • Only test systems they own or have permission to test
  • Comply with applicable laws and regulations
  • Use findings to improve security, not cause harm
  • Report vulnerabilities responsibly

Future Security Enhancements

  1. Multi-factor Authentication: Implement MFA for sensitive operations
  2. Rate Limiting: Add rate limiting for network operations
  3. Encryption at Rest: Encrypt stored session data
  4. Certificate Validation: Enhanced SSL/TLS certificate validation
  5. Sandbox Mode: Isolated execution environment for untrusted code

Contact

For security issues or questions:

  • Author: Mauro Risonho de Paula Assumpção (firebitsbr)
  • Please report security vulnerabilities responsibly

Note: This security documentation should be reviewed and updated regularly as new threats are discovered and mitigations are implemented.

There aren’t any published security advisories