Skip to main content

Module path_validator

Module path_validator 

Source
Expand description

Path validation for file operations.

This module provides security checks for file paths to prevent:

  • Path traversal attacks (e.g., ../../../etc/passwd)
  • Accessing files outside project directory
  • Writing to critical system files

Constants§

MAX_FILE_SIZE
Maximum allowed file size (10MB)
MAX_PATH_LENGTH
Maximum allowed path length

Functions§

validate_content_size
Validate content size for file writes.
validate_path
Validate a file path for security.