UNPKG

mcp-cve-intelligence-server-lite-test

Version:

Lite Model Context Protocol server for comprehensive CVE intelligence gathering with multi-source exploit discovery, designed for security professionals and cybersecurity researchers - Alpha Release

79 lines 2.79 kB
/** * CVE and data validation utilities */ /** * Infrastructure-focused input sanitization for CVE intelligence server * ONLY removes characters that could damage the server infrastructure * Preserves ALL vulnerability data - attackers can attack APIs directly anyway */ export declare function sanitizeInput(input: string, maxLength?: number): string; /** * Validates and sanitizes CVE ID with enhanced checks */ export declare function validateAndSanitizeCVEId(cveId: string): string; /** * Validates and sanitizes search parameters * For MCP JSON-RPC requests - parameter names come from SDK and are safe */ export declare function validateSearchParameters(params: Record<string, unknown>): Record<string, unknown>; /** * Type guard to check if a value is a non-empty string */ export declare function isNonEmptyString(value: unknown): value is string; /** * Type guard to check if a value is a valid number */ export declare function isValidNumber(value: unknown): value is number; /** * Type guard to check if a value is a non-empty array */ export declare function isNonEmptyArray<T>(value: unknown): value is T[]; /** * Safely converts a value to string with fallback */ export declare function safeString(value: unknown, fallback?: string): string; /** * Safely converts a value to number with fallback */ export declare function safeNumber(value: unknown, fallback?: number): number; /** * Validates CVE ID format * @param cveId CVE identifier to validate * @returns true if valid CVE format */ export declare function isValidCVEId(cveId: string): boolean; /** * Normalizes and deduplicates CVE IDs (case-insensitive) * @param cveIds Array of CVE identifiers * @returns Array of normalized unique CVE IDs */ export declare function normalizeAndDeduplicateCVEIds(cveIds: string[]): string[]; /** * Validates date range parameters * @param startDate Start date string * @param endDate End date string * @returns true if valid date range */ export declare function isValidDateRange(startDate?: string, endDate?: string): boolean; /** * Parses CPE (Common Platform Enumeration) string * @param cpe CPE string to parse * @returns Parsed CPE components */ export declare function parseCPE(cpe: string): { vendor: string; product: string; version?: string; }; /** * Gets exploit indicator patterns from configuration * @returns Map of exploit indicator patterns */ export declare function getExploitIndicators(): Record<string, RegExp>; /** * Validates and normalizes a required environment variable * @param name Environment variable name * @returns Environment variable value * @throws Error if variable is not set */ export declare function getRequiredEnvVar(name: string): string; //# sourceMappingURL=validation.d.ts.map