Expand description
Cross-Platform Path Validation Module
This module provides robust, platform-agnostic path validation that prevents:
- Directory traversal attacks (../, .., encoded variants)
- Absolute path access (/etc/passwd, C:\Windows\System32)
- UNC path attacks (\server\share)
- URL-encoded traversal (%2e%2e/, %252e%252e/)
- Null byte injection (file.xml%00.txt)
- Symlink attacks and canonicalization issues
- Unicode normalization attacks
The validator works identically across Windows, Linux, and macOS by:
- Normalizing all paths to forward slashes internally
- Using platform-specific canonicalization when available
- Implementing whitelist-based validation
- Resolving symlinks and checking final destinations
Structsยง
- Path
Validation Config - Path validation configuration
- Path
Validator - Cross-platform path validator
- Validated
Path - Result of path validation