/** * Secure YAML parsing utility. * * Provides safe YAML parsing with protection against: * - Alias bombs (billion laughs attack) via maxAliasCount * - Excessive nesting via depth validation * - Circular references */ import { type ParseOptions } from 'yaml'; /** * Default security limits for YAML parsing. */ export declare const YAML_SECURITY_LIMITS: { /** Maximum number of aliases to resolve (prevents billion laughs attack) */ MAX_ALIAS_COUNT: number; /** Maximum nesting depth for parsed structures */ MAX_DEPTH: number; /** Maximum size of input in characters */ MAX_INPUT_SIZE: number; }; /** * Options for secure YAML parsing. */ export interface SecureYamlOptions { /** Maximum number of aliases to resolve (default: 100) */ maxAliasCount?: number; /** Maximum nesting depth (default: 50) */ maxDepth?: number; /** Maximum input size in characters (default: 10MB) */ maxInputSize?: number; /** Additional yaml parse options */ parseOptions?: ParseOptions; } /** * Parse YAML with security protections. * * @param content - YAML content to parse * @param options - Security options * @returns Parsed YAML value * @throws Error if parsing fails or security limits are exceeded * * @example * ```typescript * const data = parseYamlSecure(content); * const config = parseYamlSecure(content, { maxDepth: 10 }); * ``` */ export declare function parseYamlSecure(content: string, options?: SecureYamlOptions): T; /** * Parse YAML with strict security settings. * Use this for parsing untrusted input. * * @param content - YAML content to parse * @returns Parsed YAML value * @throws Error if parsing fails or security limits are exceeded */ export declare function parseYamlStrict(content: string): T; //# sourceMappingURL=yaml-parser.d.ts.map