Documentation
¶
Overview ¶
Package safeshell provides a secure wrapper for subprocess command execution to prevent shell injection.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommandContext ¶
CommandContext creates a validated, secure exec.Cmd wrapper. It checks the command name for control characters and null bytes, and validates arguments against null bytes.
func Validate ¶
Validate checks a string argument for safety indicators (e.g. null bytes). Note: In direct execve subprocess execution, operators like |, &, ;, <, >, `, $ and newlines are safe in arguments as they are passed directly without shell interpretation.
func ValidateCommandName ¶ added in v0.34.0
ValidateCommandName checks a command executable name for control characters, newlines, and null bytes.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.