UNPKG

sicua

Version:

A tool for analyzing project structure and dependencies

60 lines (59 loc) 1.61 kB
/** * Detector for insecure cookie patterns and configurations */ import { BaseDetector } from "./BaseDetector"; import { Vulnerability } from "../types/vulnerability.types"; import { ScanResult } from "../../../types"; export declare class InsecureCookieDetector extends BaseDetector { private static readonly COOKIE_PATTERNS; constructor(); detect(scanResult: ScanResult): Promise<Vulnerability[]>; /** * Detect cookie libraries used in the file */ private detectCookieLibraries; /** * Validate if a cookie pattern match is problematic */ private validateCookieMatch; /** * Check if cookie usage is for non-sensitive UI state */ private isUIStateCookie; /** * AST-based analysis for insecure cookie usage */ private analyzeASTForInsecureCookies; /** * Find document.cookie assignments */ private findDocumentCookieAssignments; /** * Find cookie library function calls */ private findCookieLibraryCalls; /** * Analyze document.cookie assignment */ private analyzeCookieAssignment; /** * Analyze cookie library call */ private analyzeCookieLibraryCall; /** * Extract cookie string from assignment */ private extractCookieString; /** * Analyze cookie security attributes */ private analyzeCookieSecurity; /** * Analyze cookie options object from library calls */ private analyzeCookieOptions; /** * Extract function name from AST node context */ private extractFunctionFromAST; }