sicua
Version:
A tool for analyzing project structure and dependencies
84 lines (83 loc) • 2.22 kB
TypeScript
/**
* Detector for mixed content vulnerabilities (HTTP resources in HTTPS context)
*/
import { BaseDetector } from "./BaseDetector";
import { Vulnerability } from "../types/vulnerability.types";
import { ScanResult } from "../../../types";
export declare class MixedContentDetector extends BaseDetector {
private static readonly MIXED_CONTENT_PATTERNS;
constructor();
detect(scanResult: ScanResult): Promise<Vulnerability[]>;
/**
* Validate if a mixed content match is actually risky
*/
private validateMixedContentMatch;
/**
* AST-based analysis for mixed content detection
*/
private analyzeASTForMixedContent;
/**
* Find string literals containing HTTP URLs
*/
private findHTTPStringLiterals;
/**
* Find JSX attributes with HTTP URLs
*/
private findJSXHTTPAttributes;
/**
* Assess the risk of mixed content for a string literal
*/
private assessMixedContentRisk;
/**
* Determine how a URL is being used
*/
private determineURLUsageContext;
/**
* Analyze JSX HTTP attribute
*/
private analyzeJSXHTTPAttribute;
/**
* Get URL from JSX attribute
*/
private getJSXAttributeURL;
/**
* Get risk level for JSX attribute
*/
private getJSXAttributeRiskLevel;
/**
* Extract URL from pattern match
*/
private extractURLFromMatch;
/**
* Check if HTTP context is allowed (development/localhost)
*/
private isAllowedHTTPContext;
/**
* Check if URL is a standard XML namespace declaration
*/
private isXMLNamespace;
/**
* Get variable name for string literal
*/
private getVariableNameForStringLiteral;
/**
* Check if variable name is URL-related
*/
private isURLRelatedVariable;
/**
* Check if property name is URL-related
*/
private isURLRelatedProperty;
/**
* Get risk level based on usage context
*/
private getRiskLevel;
/**
* Get confidence level based on usage context
*/
private getConfidenceLevel;
/**
* Extract function name from AST node context
*/
private extractFunctionFromAST;
}