Skip to main content

Module validation

Module validation 

Source
Expand description

Shared validation utilities for validating and sanitizing user input.

This module provides security utilities for validating user input that can be reused between the bssh client and server implementations.

§Security

These functions are designed to prevent:

  • Path traversal attacks
  • Command injection
  • Information leakage through error messages

Functions§

sanitize_error_message
Sanitize error messages to prevent information leakage.
validate_hostname
Sanitize a hostname to prevent injection attacks.
validate_local_path
Validate and sanitize a local file path to prevent path traversal attacks.
validate_remote_path
Validate a remote path string to prevent injection attacks.
validate_username
Validate a username to prevent injection attacks.