Skip to main content

validate_path_in_workspace

Function validate_path_in_workspace 

Source
pub fn validate_path_in_workspace(
    path: &Path,
    workspace_root: &Path,
) -> Result<PathBuf, PathSecurityError>
Expand description

Validates that a path is within the workspace root. Returns the canonicalized path if valid.

ยงSecurity

  • Prevents path traversal attacks (../)
  • Detects symlinks pointing outside workspace
  • Canonicalizes path before comparison