Module path_security

Module path_security 

Source
Expand description

Path validation and sanitization to prevent path traversal attacks

This module provides security-critical functions to validate output paths and sanitize filenames, preventing malicious servers from writing arbitrary files via crafted tool names.

Functions§

safe_output_path
Validates and sanitizes a filename, then constructs a safe output path.
sanitize_filename
Sanitizes a filename to prevent security issues.
validate_output_path
Validates an output path to ensure it’s within the base directory.