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.