/** * File Organizer MCP Server v3.4.2 * Security Amendments - Security Constants & Limits * * These security limits are mandatory for all archive operations * and must be enforced at the earliest possible point. */ export declare const SECURITY_LIMITS: { /** * Decompression Bomb Mitigation Limits * Prevention: 256B → 10GB attack vectors */ readonly decompression: { /** * Maximum compression ratio (uncompressed / compressed) * 10x means 256KB compressed → 2.5MB max uncompressed */ readonly MAX_RATIO: 10; /** * Maximum absolute uncompressed size per chunk * 2.5GB per chunk prevents memory exhaustion */ readonly MAX_ABSOLUTE_BYTES: number; /** * Maximum total entries in an archive * Prevents zip bomb with millions of small files */ readonly MAX_ENTRIES: 10000; /** * Maximum individual file size within archive * 1GB per file limit */ readonly MAX_FILE_SIZE: number; /** * Stream chunk size for incremental processing * 64KB chunks for memory efficiency */ readonly CHUNK_SIZE: number; }; /** * Thread Isolation Configuration * Prevention: Shared memory race conditions */ readonly threadIsolation: { /** * Prefix for dedicated temporary directories * Each operation gets unique temp dir */ readonly TEMP_DIR_PREFIX: "fo-"; /** * Maximum temp directories allowed concurrently * Prevents resource exhaustion */ readonly MAX_CONCURRENT_TEMP_DIRS: 10; /** * Temp directory cleanup timeout (ms) * 5 minutes to complete operations */ readonly CLEANUP_TIMEOUT_MS: number; }; /** * Archive Validation Configuration * Prevention: Zip-slip attacks */ readonly archiveValidation: { /** * Magic numbers for supported archive formats * Used to verify file type before processing */ readonly MAGIC_NUMBERS: { readonly zip: readonly [80, 75, 3, 4]; readonly zipEmpty: readonly [80, 75, 5, 6]; readonly zipSpanned: readonly [80, 75, 7, 8]; readonly tar: readonly [117, 115, 116, 97, 114]; readonly gz: readonly [31, 139]; readonly bz2: readonly [66, 90, 104]; readonly xz: readonly [253, 55, 122, 88, 90, 0]; readonly "7z": readonly [55, 122, 188, 175, 39, 28]; }; /** * Maximum length for a single path component (filename/directory name) * 255 characters is the standard filesystem limit for individual names */ readonly MAX_PATH_COMPONENT_LENGTH: 255; /** * Maximum total path length for entries * 260 characters is a conservative cross-platform value (Windows MAX_PATH) * Note: Linux typically allows 4096, but we use conservative limit */ readonly MAX_PATH_LENGTH: 260; /** * Reserved paths that must never be extracted * Absolute paths and parent directory traversals */ readonly BLOCKED_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp]; }; /** * Security Integration Phase Markers * These ensure security is embedded in all phases */ readonly phases: { readonly INPUT: "input"; readonly PROCESSING: "processing"; readonly OUTPUT: "output"; readonly CLEANUP: "cleanup"; }; }; export type SecurityPhase = (typeof SECURITY_LIMITS.phases)[keyof typeof SECURITY_LIMITS.phases]; //# sourceMappingURL=security-constants.d.ts.map