ailock
Version:
AI-Proof File Guard - Protect sensitive files from accidental AI modifications
31 lines • 911 B
TypeScript
/**
* Security-focused path validation to prevent directory traversal
* and other path-based security vulnerabilities
*/
export declare class SecurityValidator {
private readonly allowedRootDirs;
private readonly maxPathLength;
private readonly maxComponentLength;
constructor(allowedRootDirs?: string[]);
/**
* Validate path security to prevent directory traversal attacks
*/
validatePathSecurity(inputPath: string): void;
/**
* Validate individual path component
*/
private validatePathComponent;
/**
* Check if path is within allowed directories
*/
isPathAllowed(resolvedPath: string): boolean;
/**
* Check if filename is a Windows reserved name
*/
private isWindowsReservedName;
/**
* Get allowed root directories
*/
getAllowedRootDirs(): string[];
}
//# sourceMappingURL=SecurityValidator.d.ts.map