/** * Enhanced Security Utilities for TONL * Backward compatible security validation and protection */ import { SecurityLimits, DEFAULT_SECURITY_LIMITS } from './security-limits.js'; export type { SecurityLimits }; export { DEFAULT_SECURITY_LIMITS }; /** * Regex Security Validator * Provides enhanced protection against ReDoS attacks */ export declare class RegexValidator { private static readonly DANGEROUS_PATTERNS; private static readonly DANGEROUS_SEQUENCES; /** * Validate regex pattern for security vulnerabilities * @param pattern - The regex pattern to validate * @param limits - Security limits to apply * @throws SecurityError if pattern is dangerous */ static validateRegexPattern(pattern: string, limits?: SecurityLimits): void; /** * Calculate regex pattern nesting depth * @param pattern - The regex pattern to analyze * @returns The nesting depth */ private static calculateNestingDepth; } /** * Input Security Validator * Provides comprehensive input validation */ export declare class InputValidator { /** * Validate input size and complexity * @param input - The input to validate * @param limits - Security limits to apply * @throws SecurityError if input is too large or complex */ static validateInput(input: string, limits?: SecurityLimits): void; /** * Validate nesting depth in JSON-like structure * @param input - The input to validate * @param limits - Security limits to apply * @throws SecurityError if nesting is too deep */ static validateNestingDepth(input: string, limits?: SecurityLimits): void; } /** * Security utilities for safe operations */ export declare class SecurityUtils { /** * Safe JSON parsing with ReDoS protection * @param input - The JSON string to parse * @param limits - Security limits to apply * @returns Parsed JSON object * @throws SecurityError if input is malicious */ static safeJsonParse(input: string, limits?: SecurityLimits): any; /** * Validate file path for security * @param path - The file path to validate * @throws SecurityError if path is dangerous */ static validateFilePath(path: string): void; /** * Sanitize user input for safe processing * @param input - The input to sanitize * @returns Sanitized input */ static sanitizeInput(input: string): string; } //# sourceMappingURL=security.d.ts.map