UNPKG

sicua

Version:

A tool for analyzing project structure and dependencies

72 lines (71 loc) 1.97 kB
/** * Detector for client-side storage of sensitive data */ import { BaseDetector } from "./BaseDetector"; import { Vulnerability } from "../types/vulnerability.types"; import { ScanResult } from "../../../types"; export declare class ClientStorageDetector extends BaseDetector { private static readonly STORAGE_PATTERNS; constructor(); detect(scanResult: ScanResult): Promise<Vulnerability[]>; /** * Detect storage libraries used in the file */ private detectStorageLibraries; /** * Validate if a storage pattern match is problematic */ private validateStorageMatch; /** * AST-based analysis for client storage usage */ private analyzeASTForClientStorage; /** * Find storage API calls (localStorage, sessionStorage, etc.) */ private findStorageApiCalls; /** * Find storage library calls */ private findStorageLibraryCalls; /** * Analyze storage API call */ private analyzeStorageApiCall; /** * Analyze storage library call */ private analyzeStorageLibraryCall; /** * Get storage type and method information */ private getStorageInfo; /** * Analyze storage call for sensitive data */ private analyzeStorageSensitivity; /** * Extract sensitive data indicators from function argument */ private extractSensitiveDataFromArgument; /** * Check if storage usage is for UI state rather than sensitive data */ private isUIStateStorage; /** * Determine sensitivity level based on found keywords */ private determineSensitivityLevel; /** * Determine confidence level based on context */ private determineConfidenceLevel; /** * Generate storage security recommendations */ private generateStorageRecommendations; /** * Extract function name from AST node context */ private extractFunctionFromAST; }