UNPKG

sicua

Version:

A tool for analyzing project structure and dependencies

56 lines (55 loc) 1.66 kB
/** * Detector for environment variable exposure in client-side code */ import { BaseDetector } from "./BaseDetector"; import { Vulnerability } from "../types/vulnerability.types"; import { ScanResult } from "../../../types"; export declare class EnvironmentExposureDetector extends BaseDetector { private static readonly ENV_PATTERNS; constructor(); detect(scanResult: ScanResult): Promise<Vulnerability[]>; /** * Validate if an environment variable match is problematic */ private validateEnvMatch; /** * AST-based analysis for environment variable exposure */ private analyzeASTForEnvExposure; /** * Find all process.env property access expressions */ private findProcessEnvAccess; /** * Get environment variable name from property access */ private getEnvVariableName; /** * Assess the risk of using an environment variable in client code */ private assessEnvVariableRisk; /** * Extract environment variable name from match string */ private extractEnvVariableName; /** * Check if environment variable is safe for client-side use */ private isClientSafeEnvVar; /** * Check if environment variable is server-only */ private isServerOnlyEnvVar; /** * Check if environment variable name looks sensitive */ private looksLikeSensitiveEnvVar; /** * Check if environment variable usage is properly gated for development */ private isProperlyGatedForDevelopment; /** * Extract function name from AST node context */ private extractFunctionFromAST; }