cve_discovery
Identify Common Vulnerabilities and Exposures (CVEs) by analyzing detected technologies and their versions to support security assessments.
Instructions
Discover CVEs based on detected technologies and versions
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| technologies | Yes | Array of detected technologies with versions |
Implementation Reference
- src/tools/cve-discovery.ts:29-82 (handler)Core handler function that orchestrates CVE discovery across multiple databases (NVD, ExploitDB, Vulners, MITRE) for detected technologies, deduplicates results, sorts by severity, and returns formatted ScanResult.
async discoverCVEs(technologies: TechDetectionResult[]): Promise<ScanResult> { try { const cveResults: CVEResult[] = []; console.error(`🔍 Discovering CVEs for ${technologies.length} technologies...`); for (const tech of technologies) { console.error(` Searching CVEs for ${tech.technology} ${tech.version || ''}`); // Search multiple CVE databases const nvdResults = await this.searchNVD(tech); const exploitDbResults = await this.searchExploitDB(tech); const vulnersResults = await this.searchVulners(tech); const mitreResults = await this.searchMITRE(tech); cveResults.push(...nvdResults, ...exploitDbResults, ...vulnersResults, ...mitreResults); } // Remove duplicates and sort by CVSS score const uniqueCVEs = this.deduplicateCVEs(cveResults); const sortedCVEs = uniqueCVEs.sort((a, b) => b.cvss_score - a.cvss_score); return { target: 'cve_discovery', timestamp: new Date().toISOString(), tool: 'cve_discovery', results: { total_cves_found: sortedCVEs.length, critical_cves: sortedCVEs.filter(c => c.severity === 'critical').length, high_cves: sortedCVEs.filter(c => c.severity === 'high').length, exploitable_cves: sortedCVEs.filter(c => c.exploit_available).length, cves: sortedCVEs.slice(0, 50), // Top 50 most critical technology_coverage: technologies.map(t => ({ technology: t.technology, version: t.version, cve_count: sortedCVEs.filter(c => c.affected_product.toLowerCase().includes(t.technology.toLowerCase()) ).length })) }, status: 'success' }; } catch (error) { return { target: 'cve_discovery', timestamp: new Date().toISOString(), tool: 'cve_discovery', results: {}, status: 'error', error: error instanceof Error ? error.message : String(error) }; } } - src/index.ts:546-547 (registration)Tool call routing in the main MCP server handler: dispatches 'cve_discovery' calls to the CVEDiscoveryEngine instance.
case "cve_discovery": return respond(await this.cveDiscovery.discoverCVEs(args.technologies)); - src/index.ts:256-268 (schema)MCP tool registration including name, description, and input schema definition for 'cve_discovery'.
name: "cve_discovery", description: "Discover CVEs based on detected technologies and versions", inputSchema: { type: "object", properties: { technologies: { type: "array", items: { type: "object" }, description: "Array of detected technologies with versions" } }, required: ["technologies"] } - src/tools/cve-discovery.ts:4-18 (schema)TypeScript interface defining the structure of CVE results used in the tool's output.
export interface CVEResult { cve_id: string; cvss_score: number; severity: 'low' | 'medium' | 'high' | 'critical'; description: string; published_date: string; modified_date: string; affected_product: string; affected_version: string; references: string[]; exploit_available: boolean; exploit_links: string[]; cwe_id?: string; vector_string?: string; } - src/index.ts:59-59 (registration)Instantiation of the CVEDiscoveryEngine class in the main PentestMCPServer constructor.
this.cveDiscovery = new CVEDiscoveryEngine();