/** * Miyabi MCP Bundle - Security Utilities * * Functions for input sanitization and security validation. */ /** * Sanitize shell argument to prevent command injection * Removes dangerous characters that could be used for injection attacks */ export declare function sanitizeShellArg(arg: string): string; /** * Validate and sanitize path to prevent traversal and symlink attacks * @throws Error if path traversal or symlink attack detected */ export declare function sanitizePath(basePath: string, userPath: string): string; /** * Validate input string length * @returns Error message if validation fails, null if valid */ export declare function validateInputLength(value: string, maxLength: number, fieldName: string): string | null; /** * Validate query string (length check) */ export declare function validateQuery(query: string): string | null; /** * Validate path string (length check) */ export declare function validatePath(path: string): string | null; /** * Validate hostname string (length check) */ export declare function validateHostnameLength(hostname: string): string | null; /** * Validate hostname format (DNS-compatible) * Allows: alphanumeric, hyphens, dots, IPv4 addresses */ export declare function isValidHostname(hostname: string): boolean; /** * Validate process ID (PID) */ export declare function isValidPid(pid: unknown): boolean; /** * Check if a command exists on the system * Uses 'which' on Unix-like systems, 'where' on Windows */ export declare function commandExists(cmd: string, execAsync: (cmd: string) => Promise<{ stdout: string; }>): Promise; //# sourceMappingURL=security.d.ts.map