import type { ValidationRule, ValidationContext } from '../interfaces'; import { ValidationSeverity } from '../interfaces'; /** * Configuration options for NoGlobalAccessRule */ export interface NoGlobalAccessOptions { /** List of global object names to block access to */ blockedGlobals?: string[]; /** Whether to block member access to globals */ blockMemberAccess?: boolean; /** Whether to block computed access to globals */ blockComputedAccess?: boolean; } /** * Rule that prevents access to global objects (window, globalThis, this) * * This blocks attack vectors like: * - window['eval'] * - globalThis.Function * - this['constructor'] * - window[dynamicVar] * * Rationale: Even with identifier transformation, attackers can access * dangerous functions through global object references. */ export declare class NoGlobalAccessRule implements ValidationRule { readonly name = "no-global-access"; readonly description = "Prevents access to global objects that can bypass security"; readonly defaultSeverity = ValidationSeverity.ERROR; readonly enabledByDefault = false; private readonly blockedGlobals; private readonly blockMemberAccess; private readonly blockComputedAccess; constructor(options?: NoGlobalAccessOptions); validate(context: ValidationContext): void; }