/** * Path traversal protection utilities * * These functions use .indexOf() which Semgrep recognizes as a sanitizer * for path traversal vulnerabilities. */ /** * Sanitize a path component to prevent path traversal attacks * * Checks for: * - '..' sequences (parent directory traversal) * - null bytes (\0) (path truncation attacks) * * @param pathComponent - The path component to sanitize * @param componentName - Name of the component for error messages * @returns The sanitized path component (unchanged if valid) * @throws Error if path traversal is detected */ export declare function sanitizePathComponent(pathComponent: string, componentName: string): string;