Security Policy for Home Programming Language

On this page 25

This document outlines the security architecture, assumptions, and guidelines for the Home programming language.

Security Features

Memory Safety

Home provides memory safety without garbage collection through:

  1. Ownership System

    • Each value has exactly one owner
    • Values are automatically dropped when owner goes out of scope
    • No dangling pointers possible
  2. Borrow Checking

    • References cannot outlive their referents
    • Aliasing XOR mutability rule enforced at compile time
    • No data races in single-threaded code
  3. Bounds Checking

    • Array access is bounds-checked by default
    • Slice operations verify ranges
    • Can be disabled in release builds with -Drelease-fast

Input Validation

The validation framework (packages/validation) provides:

LimitDefaultStrict Mode
Max recursion depth25664
Max input size10MB1MB
Max tokens1,000,000100,000
Max AST nodes500,00050,000
Parse timeout30s5s

Type Safety

  • Static type checking prevents type confusion
  • No implicit type coercions
  • Algebraic data types for safe error handling
  • Null safety via Optional types

Security Assumptions

Trusted Components

The following are assumed to be trusted:

  1. Compiler binary - The Home compiler itself
  2. Standard library - Built-in packages
  3. Build system - Zig build infrastructure
  4. Operating system - Host OS kernel and runtime

Untrusted Components

The following are treated as potentially untrusted:

  1. User source code - Subject to validation limits
  2. External dependencies - Should be audited
  3. Runtime input - Must be validated by programs
  4. Network data - Never trusted by default

Known Limitations

Not Protected Against

  1. Logic bugs - Semantic errors in correct code
  2. Side channels - Timing attacks not mitigated
  3. Physical attacks - No protection against hardware attacks
  4. Supply chain - Dependency security not verified automatically

FFI Boundaries

Foreign function interface (FFI) code:

  • Is inherently unsafe
  • Can violate memory safety guarantees
  • Should be minimized and carefully audited
  • Must use unsafe blocks (planned)

Vulnerability Reporting

Responsible Disclosure

Please report security vulnerabilities by:

  1. Email: security@home-lang.org (planned)
  2. GitHub: Private security advisory
  3. PGP: Use our public key for encrypted reports

What to Include

  • Description of the vulnerability
  • Steps to reproduce
  • Potential impact
  • Suggested fix (if any)

Response Timeline

PhaseTimeframe
Initial response24-48 hours
Severity assessment1 week
Fix development2-4 weeks
Public disclosureAfter fix released

Security Best Practices

For Language Users

  1. Enable strict validation for untrusted input

    const config = ValidationConfig.strict();
    
  2. Use Result types for error handling

    fn read_file(path: string): Result<string, Error>
    
  3. Validate external data at system boundaries

    fn handle_request(data: []u8): Result<Response, Error> {
        let validated = try validate(data);
        // ...
    }
    
  4. Minimize FFI usage and audit FFI code

For Compiler Development

  1. Fuzz all parsers - lexer, parser, codecs
  2. Limit resource usage - memory, recursion, time
  3. Fail safely - errors should not leak state
  4. Audit dependencies - minimize and verify

Cryptography

Current Status

Home does not include cryptographic primitives in the standard library. For cryptographic operations:

  1. Use well-audited external libraries
  2. Consider libsodium or similar
  3. Never implement custom cryptography

Planned Features

  • Integration with system crypto APIs
  • Secure random number generation
  • Constant-time comparison utilities

Audit History

DateScopeFindingsStatus
--No formal audits yetPlanned

Compliance

Standards

Home aims to comply with:

  • CERT Secure Coding Guidelines
  • OWASP recommendations
  • CWE/SANS Top 25

Security Testing

Regular security testing includes:

  • Static analysis (linter)
  • Fuzz testing (packages/fuzz)
  • Code review for security-sensitive changes

Contact

For security-related questions, contact the maintainers through GitHub issues (for non-sensitive matters) or the security email for vulnerability reports.

Released under the MIT License.